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
When trying to build a webapp with an isomorphic dependency that uses NodeJS conditional exports, the build loads the NodeJS version of the dependency.
I expected Parcel to use the browser version of the library.
😯 Current Behavior
Parcel loads the NodeJS version of the library and attempts to install polyfills:
🚨 Build failed.
@parcel/core: Failed to resolve 'node:buffer' from './node_modules/crypto-hash/index.js'
/Volumes/Workspace/work/data/parcel-repro/node_modules/crypto-hash/index.js:1:22
> 1 | import {Buffer} from 'node:buffer';
> | ^^^^^^^^^^^^^
2 | import {Worker} from 'node:worker_threads';
3 | import crypto from 'node:crypto';
@parcel/resolver-default: Node builtin polyfill "buffer" is not installed, but auto install is disabled.
/Volumes/Workspace/work/data/parcel-repro/node_modules/crypto-hash/index.js:1:22
> 1 | import {Buffer} from 'node:buffer';
> | ^^^^^^^^^^^^^ used here
2 | import {Worker} from 'node:worker_threads';
3 | import crypto from 'node:crypto';
💡 Install the "buffer" package with your package manager, and run Parcel again.
📝 Learn more
🐛 bug report
When trying to build a webapp with an isomorphic dependency that uses NodeJS conditional exports, the build loads the NodeJS version of the dependency.
🎛 Configuration (.babelrc, package.json, cli command)
package.json
index.js
index.html
🤔 Expected Behavior
I expected Parcel to use the browser version of the library.
😯 Current Behavior
Parcel loads the NodeJS version of the library and attempts to install polyfills:
🔦 Context
The dependency uses Conditional exports .
I was able to have the build working by setting an alias:
💻 Code Sample
See above
🌍 Your Environment
The text was updated successfully, but these errors were encountered: