-
Notifications
You must be signed in to change notification settings - Fork 181
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
"import" fails if file extension is not included #712
Labels
bug
Something isn't working
Comments
Hi, Thank you for reaching out, we'll take a look into it shortly. |
I had a quick look at your example, and -- if I am not mistaken -- node.js also throws an error with
In any case, you can use a Truffle FS to customize how ES modules are loaded, and there is no need to use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When importing a local (non-NPM) module the import fails if the file extension is not included. For example
import { Worker } from './worker';
If "js.commonjs-require" is "false" the error is
Error: Error reading: /path/to/file/worker
If "js.commonjs-require" is "true" the error is
TypeError: Module not found: './worker'
Example attached.
graaljs-import.zip
To run:
mvn package exec:java
Expected: It should be able to resolve
./worker
to./worker.js
, as node does.The text was updated successfully, but these errors were encountered: