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

Broken JSPYBridge support #414

Open
SilkePilon opened this issue Dec 19, 2023 · 5 comments
Open

Broken JSPYBridge support #414

SilkePilon opened this issue Dec 19, 2023 · 5 comments

Comments

@SilkePilon
Copy link
Contributor

when using require("prismarine-viewer") i get this error:

require() of ES Module /home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/@tweenjs/tween.js/dist/tween.cjs.js from /home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/prismarine-viewer/viewer/lib/viewer.js not supported.\ntween.cjs.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.\nInstead rename tween.cjs.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/@tweenjs/tween.js/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).\n\n at Object.<anonymous> (/home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/prismarine-viewer/viewer/lib/viewer.js:2:15)\n at Object.<anonymous> (/home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/prismarine-viewer/viewer/index.js:2:11)\n at Object.<anonymous> (/home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/prismarine-viewer/lib/mineflayer.js:2:23)\n at Object.<anonymous> (/home/silke/.pyenv/versions/3.11.6/lib/python3.11/site-packages/javascript/js/node_modules/prismarine-viewer/index.js:2:15)')

@SilkePilon
Copy link
Contributor Author

maybe this is a bug with jspybridge but idk

@SilkePilon
Copy link
Contributor Author

tested it and it workes fine in npm version 1.25.0 and below. 1.19 & 1.20 support broke it ig

@rom1504
Copy link
Member

rom1504 commented Dec 19, 2023

What prismarine-viewer version?

@SilkePilon
Copy link
Contributor Author

What prismarine-viewer version?

so version 1.25.0 for the viewer works but anything above that fails. Not only on my pc everyone that uses lodestone also gets this error. i fixed it by setting the version back to 1.25.0 in the python import.

@rom1504
Copy link
Member

rom1504 commented Dec 19, 2023

#381 probably need to roll back this

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

No branches or pull requests

2 participants