-
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
esbuild bundles CJS where ESM is available #1934
Comments
The exact problem is with the module This should actually be built from From it package.json: {
"browser": {
"./asap": "./dist/esm/browser/asap.js",
"./asap.js": "./dist/esm/browser/asap.js",
"./raw": "./dist/esm/browser/raw.js",
"./raw.js": "./dist/esm/browser/raw.js"
}
} |
|
I don't see how you comment helps @kzc.
|
Dude, go easy with the negative comments and thumbs down for people who are trying to help you for free. Compare:
to:
As far as the browser field goes, either there's a bug in the library packaging or in esbuild. |
It appears that esbuild is correctly following the browser field specification and Either of the following two patches will fix the --- a/node_modules/@react-dnd/asap/package.json
+++ b/node_modules/@react-dnd/asap/package.json
@@ -26,6 +26,6 @@
"browser": {
- "./asap": "./dist/esm/browser/asap.js",
- "./asap.js": "./dist/esm/browser/asap.js",
- "./raw": "./dist/esm/browser/raw.js",
- "./raw.js": "./dist/esm/browser/raw.js"
+ "./dist/cjs/node/asap": "./dist/esm/browser/asap.js",
+ "./dist/cjs/node/asap.js": "./dist/esm/browser/asap.js",
+ "./dist/cjs/node/raw": "./dist/esm/browser/raw.js",
+ "./dist/cjs/node/raw.js": "./dist/esm/browser/raw.js"
}, --- a/node_modules/@react-dnd/asap/package.json
+++ b/node_modules/@react-dnd/asap/package.json
@@ -26,6 +26 @@
- "browser": {
- "./asap": "./dist/esm/browser/asap.js",
- "./asap.js": "./dist/esm/browser/asap.js",
- "./raw": "./dist/esm/browser/raw.js",
- "./raw.js": "./dist/esm/browser/raw.js"
- },
+ "browser": "dist/esm/browser/index.js", Either patch will allow esbuild to bundle successfully with the previously failing default But using |
All right, I understand @kzc. Thank you for a thorough explanation. And sorry about my initial negative reaction. I interpreted your comment as being passive-aggressively laconic. I will report to |
https://github.com/react-dnd/react-dnd/search?q=asap. |
Please see this gist: https://gist.github.com/tpluscode/95fa409164edbe5b6655847e7c787887
The issue I'm having is that esbuild apparently chooses CJS builds of certain dependencies where they are bundled with ESM too
The text was updated successfully, but these errors were encountered: