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
Trying to use uuid library with esbuild, and using yarn berry with PNP, so esbuild-plugin-pnp is needed. The uuid library has different exports for browser vs node, and I set esbuild's platform to browser, but the plugin is causing it to ignore the browser export and bundle the node version instead. This results in esbuild exporting a browser bundle that relies on a node built-in, which can't run in the browser.
I setup two identical projects using uuid. The only difference between the two is one uses yarn berry, and one uses yarn classic. With yarn classic, everything works as expected, and the out.js file contains the browser version of the code. With yarn berry, it uses the node version of the code and the out.js file is much longer. Given both projects have the same input file and the same esbuild config, I would expect the outputs to be the same, but they are much different.
Environment if relevant (please complete the following information):
OS: Linux
Node version v14.16.0
Yarn version 1.22.4 and 2.4.2
Additional context
I love PNP and use it for a large project at my company. However, when trying to switch to esbuild for better performance, I ran into these issues, forcing me back to webpack/rollup. Would love to see this (I assume fairly common) setup support so that esbuild can continue being used and grown.
The text was updated successfully, but these errors were encountered:
Native support for PnP was added to [email protected] so @yarnpkg/esbuild-plugin-pnp is no longer required and is getting deprecated, if you experience any issues with the PnP support in esbuild please report them upstream.
Describe the bug
Trying to use
uuid
library withesbuild
, and using yarn berry with PNP, soesbuild-plugin-pnp
is needed. Theuuid
library has different exports for browser vs node, and I setesbuild
's platform tobrowser
, but the plugin is causing it to ignore the browser export and bundle the node version instead. This results in esbuild exporting a browser bundle that relies on a node built-in, which can't run in the browser.To Reproduce
See https://github.com/SteffeyDev/eslint-pnp-bug-reproduction
I setup two identical projects using
uuid
. The only difference between the two is one uses yarn berry, and one uses yarn classic. With yarn classic, everything works as expected, and theout.js
file contains the browser version of the code. With yarn berry, it uses the node version of the code and theout.js
file is much longer. Given both projects have the same input file and the same esbuild config, I would expect the outputs to be the same, but they are much different.Environment if relevant (please complete the following information):
Additional context
I love PNP and use it for a large project at my company. However, when trying to switch to esbuild for better performance, I ran into these issues, forcing me back to webpack/rollup. Would love to see this (I assume fairly common) setup support so that esbuild can continue being used and grown.
The text was updated successfully, but these errors were encountered: