-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
target node14.6.0 emits unsupported code #2315
Comments
I believe this is because node's support for simulating esm named exports was just added in node14.13 (#35249), which causes your // lib.js (commonjs)
exports.a = 42
// index.mjs (esm)
import { a } from "./lib.js" // only works in >= node14.13 Before 14.13 you could only do |
@hyrious 👀 are these info for Evan or can I do something on my side to workaround this? |
No, I mean one tool you're using (esno) does not support node < 14.13, that's why the check failed. It even does not enter the process of doing build/transform in esbuild. I'm trying to give you more detailed info:
In conclusion: there's nothing you can do to workaround this unless you make a patch to the |
So I'm a bit confused now... |
Have you read its source code? 🤣
This is exactly a workaround to pass your CI check! If all your need is that, go for it. |
Thanks for investigating. Closing because this is not a problem with esbuild. |
Uhm... I now compared the dist from main branch and the dist from the PR (that now uses plain node and normal js, not ts or anything like that) ... and the result is the exact same 👀 So I'm not sure if this was the issue 🤔 |
The funny thing is, that if I switch target to node12, it definitely emit at least one file differently Seems like to transform some nullish coalescing or so 🤔 So could it be that prior to node v14.13 something needs to be adjusted here? I'm not sure how esbuild maps which feature is allowed for which target. |
faker-js/faker#1052
We set out target to
['es2020', 'node14.6.0']
as node v14.6 is the lowest version we want to support based on https://kangax.github.io/compat-table/es2016plus/#node14_6In the issue you can see that everything below node 14.13 is failing in the build step
(I assume) related to that, we got multiple issue reports about that Webpack and Cypress now fails when using FakerJS
This can be somewhat also be relevant for Vite and other Vue/Vite ecosystem packages 👀
The text was updated successfully, but these errors were encountered: