Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require/import of openmct doesn't work as expected #7602

Closed
ozyx opened this issue Mar 16, 2024 · 4 comments · Fixed by #7590 or akhenry/openmct-yamcs#446
Closed

Require/import of openmct doesn't work as expected #7602

ozyx opened this issue Mar 16, 2024 · 4 comments · Fixed by #7590 or akhenry/openmct-yamcs#446
Labels
type:maintenance tests, chores, or project maintenance verified Tested or intentionally closed
Milestone

Comments

@ozyx
Copy link
Contributor

ozyx commented Mar 16, 2024

Summary

see #7590 for details

@ozyx ozyx added the type:maintenance tests, chores, or project maintenance label Mar 16, 2024
@ozyx ozyx added this to the Target:4.0.0 milestone Mar 16, 2024
@ozyx ozyx self-assigned this Mar 16, 2024
@akhenry akhenry modified the milestones: Target:4.0.0, Target:4.0.1 Mar 18, 2024
@unlikelyzero unlikelyzero added this to the Target:4.0.0 milestone Mar 27, 2024
@unlikelyzero unlikelyzero added the needs:test instructions Missing testing notes label Mar 28, 2024
@ozyx
Copy link
Contributor Author

ozyx commented Apr 16, 2024

Testing Instructions

  • Create a new npm project
  • Add openmct as a dependency (npm install -D nasa/openmct)
  • Create index.js with these contents: const openmct = require('openmct');console.log(openmct);
  • node index.js
  • Verify that the openmct api is printed to the console and not undefined or any kind of errors

@unlikelyzero unlikelyzero removed the needs:test instructions Missing testing notes label Apr 25, 2024
@unlikelyzero
Copy link
Contributor

ReferenceError: window is not defined
at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:3035939
at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:4410073
at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:4410087
at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:81
at Object. (/Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:195)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)

Node.js v20.12.2

@ozyx
Copy link
Contributor Author

ozyx commented Apr 25, 2024

ReferenceError: window is not defined at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:3035939 at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:4410073 at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:4410087 at /Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:81 at Object. (/Users/jchill9/new-npm-project/node_modules/openmct/dist/openmct.js:2:195) at Module._compile (node:internal/modules/cjs/loader:1369:14) at Module._extensions..js (node:internal/modules/cjs/loader:1427:10) at Module.load (node:internal/modules/cjs/loader:1206:32) at Module._load (node:internal/modules/cjs/loader:1022:12) at Module.require (node:internal/modules/cjs/loader:1231:19)

Node.js v20.12.2

i think my testing instructions are bad or misinformed. at present i think this is correct-- openmct cannot be run in a purely node context as it relies on the window.

@unlikelyzero
Copy link
Contributor

I think this is verified by virtue of nirvss and diy working

@unlikelyzero unlikelyzero added the verified Tested or intentionally closed label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance verified Tested or intentionally closed
Projects
None yet
3 participants