You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this issue when updating to v5.x in a library that uses vitest, which itself uses esbuild. There's a known issue with esbuild where built-in Node APIs are transpiled to require calls vs. import statements for ESM targets. This causes an issue when consuming those transpiled libraries.
Error:
The line in question:
The conversion of this library to tsup, which itself uses esbuild + rollup to output the esm target output, also has manifested this issue. This library doesn't exhibit the issue itself even though it also uses vitest, but downstream consumers do, as they're using the published output, which contains the issue.
Folks at Netlify also experienced this, and they've created a PR to address it. Once that's merged we'll look to ensure the associated packages are subsequently updated once they find their way to the associated libraries.
The text was updated successfully, but these errors were encountered:
Thanks for keeping me in the loop and being proactive.
scalvert
changed the title
Node built-ins cause error in pure ESM tooling due to unmigrated require calls.
Node built-ins cause error in pure ESM tooling due to incorrectly transpiled require calls.
Apr 18, 2022
I noticed this issue when updating to v5.x in a library that uses
vitest
, which itself usesesbuild
. There's a known issue with esbuild where built-in Node APIs are transpiled to require calls vs. import statements for ESM targets. This causes an issue when consuming those transpiled libraries.Error:
The line in question:
The conversion of this library to tsup, which itself uses esbuild + rollup to output the esm target output, also has manifested this issue. This library doesn't exhibit the issue itself even though it also uses
vitest
, but downstream consumers do, as they're using the published output, which contains the issue.Folks at Netlify also experienced this, and they've created a PR to address it. Once that's merged we'll look to ensure the associated packages are subsequently updated once they find their way to the associated libraries.
The text was updated successfully, but these errors were encountered: