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

Two.js Fails to Load In Node Environments #643

Closed
1 of 3 tasks
jonobr1 opened this issue Jun 9, 2022 · 1 comment
Closed
1 of 3 tasks

Two.js Fails to Load In Node Environments #643

jonobr1 opened this issue Jun 9, 2022 · 1 comment
Labels

Comments

@jonobr1
Copy link
Owner

jonobr1 commented Jun 9, 2022

Describe the bug
Originally found here. Since porting the build processes to esbuild, Two.js has been unable to load in commonjs environments.

To Reproduce
Steps to reproduce the behavior:
Try to import Two.js in a Node environment (not ES6) via:

const Two = require('two.js');

Expected behavior
Two.js is loaded. But, the result is actually this:

Uncaught (in promise) TypeError: Two is not a constructor
    at sketch (sketch.js? [sm]:11:1)
    at SketchManager.js:967:20

Environment (please select one):

  • Code executes in browser (e.g: using script tag to load library)
  • Packaged software (e.g: ES6 imports, react, angular, vue.js)
  • Running headless (usually Node.js)
@jonobr1
Copy link
Owner Author

jonobr1 commented Jun 9, 2022

Fixed and published to v0.8.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant