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 importing a module that redirects another import using the browser field in the package.json and the module is a sub package (like @foo/module) the import is not resolved correctly.
Metro is looking for the module in node_modules/@foo instead of node_modules/@foo/module
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
npm init -y
npm i @vercel/blob metro
echo'require("@vercel/blob");'>> index.js
npx metro build index.js --out bundle.js
The following error is thrown:
None of these files exist:
* node_modules/@vercel/dist/undici-browser.js(.web.js|.native.js|.js|.web.jsx|.native.jsx|.jsx|.web.json|.native.json|.json|.web.ts|.native.ts|.ts|.web.tsx|.native.tsx|.tsx)
* node_modules/@vercel/dist/undici-browser.js/index(.web.js|.native.js|.js|.web.jsx|.native.jsx|.jsx|.web.json|.native.json|.json|.web.ts|.native.ts|.ts|.web.tsx|.native.tsx|.tsx)
What is the expected behavior?
The module should be resolved to node_modules/@vercel/blob/dist/undici-browser.js
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered:
luismeyer
changed the title
Module browser field not resolved correctly if it's is a sub package
Browser field not resolved correctly if it's is a sub package
May 14, 2024
luismeyer
changed the title
Browser field not resolved correctly if it's is a sub package
Browser field not resolved correctly if it is a sub package
May 14, 2024
luismeyer
changed the title
Browser field not resolved correctly if it is a sub package
Browser field not resolved correctly if in a sub package
May 25, 2024
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When importing a module that redirects another import using the
browser
field in the package.json and the module is a sub package (like @foo/module) the import is not resolved correctly.Metro is looking for the module in
node_modules/@foo
instead ofnode_modules/@foo/module
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.The following error is thrown:
What is the expected behavior?
The module should be resolved to node_modules/@vercel/blob/dist/undici-browser.js
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Node: v20.11.1
npm: 10.2.4
OS: macOS Sonoma 14.4.1
Related Issues:
expo/expo#28222
vercel/storage#505
The text was updated successfully, but these errors were encountered: