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

es mode cannot be used in modules #317

Open
topcoco opened this issue Apr 11, 2024 · 2 comments
Open

es mode cannot be used in modules #317

topcoco opened this issue Apr 11, 2024 · 2 comments

Comments

@topcoco
Copy link

topcoco commented Apr 11, 2024

The self-encapsulated module can only use the commonjs method and cannot write the es method, otherwise an error will occur. The reasons are as follows. I have enabled the modle mode in package.json and I do not have noop.js locally. The current es method does not seem to be able to use require in the module. () of ES Module /storage/emulated/0/Android/data/com.test/files/debug/node_modules/core/index.js from /storage/emulated/0/Android/data/coco.magichands/files/debug /noop.js not supported.
index.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.

@topcoco
Copy link
Author

topcoco commented Apr 11, 2024

Using the latest version of Android node mode

@caoccao
Copy link
Owner

caoccao commented Apr 11, 2024

Have you tried to write a custom module resolver? Node.js ESM in Javet is known to be problematic. You may ping me at discord for details.

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