-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Incompatible with ESM module (node > 13.2) #220
Comments
Hey @PacoDu, thanks for reporting! And add.js truly is located in the same directory that test.js is, I suppose? Maybe you can put the test repo on GitHub, so it’s easier to quickly try it out. |
@andywer Yes, I removed my personal path from the stacktrace but using I'll push the test repo for reproduction ;) |
I've updated the repo with some tests and a CI to demonstrate the issue: |
Checked it out and could fix a bunch of things (like adding For instance, TypeScript does not allow emitting files with the That won't work either, though, since node.js in ES module mode seems to require specifying the file extension in every I am sorry, but I think that cannot be easily fixed as of today. |
Ok, thanks for investigating the issue ;) |
Same issue, is there any workaround? |
Hmm, so threads.js doesn't work at all on node.js > 13.2? (Not running node 13/14 myself yet tbh) @kissenger Can you qickly try to |
I need to do the import as follows to avoid getting import error:
And even after removing the *.mjs files I still get the following error:
tbh I reverted my project back to commonJS modules and it works fine. I'm using node v14.2.0. |
Threads.js doesn't work with node ESM module, if
"type": "module"
is set in thepackage.json
importing threads.js as a dependency, same if main file extension is.mjs
.Worker constructor fails with the following error:
Reproduce (requires node > 13.2 and package.json
"type":"module"
):test.js
add.js
Note: adding extension to worker path or writing worker in commonJS with .cjs extension doesn't change anything.
PS: Thanks for this awesome library !
The text was updated successfully, but these errors were encountered: