Bundling for Web attempts to import node.js modules from dependencies due to improper compiler environment selection
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- firebase, javascript, node.js
- Domain
- build-system
Research direction
Start by reproducing the issue with [email protected], the firebase/auth package, and a Metro browser/web target. Investigate the compiler environment selection and verify that the browser build no longer attempts to load Node.js dependencies; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Description
Do you want to request a feature or report a bug?
Report a Bug
What is the current behavior?
When importing libraries like 'firebase' who depend use 'browser' as the main target and compiling for a metro 'browser' / web target the compiler still attempts to load node.js dependencies when it should not.
This has been previously reported to firebase-js-sdk but their staff believe this is a metro compiler issue.
See https://github.com/firebase/firebase-js-sdk/issues/7849#issuecomment-1857889012
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.
I will attempt to build you a repository for testing this as soon as I can.
This is easily reproduce when importing [email protected] and attempting to access the firebase/auth package.
What is the expected behavior?
Only browser dependencies should load in a browser-based build.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 699
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 33
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react/metro
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/metro#1927 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Async chunk URLs drop the file extension, so .cjs async imports fail with "Requiring unknown module"Open
Difficulty 3/5 1-2 days Newbie friendliness 74/100
react/metro#1959 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
react/metro#1928 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aiko-chan-ai/DiscordBotClient#380 ·
-
Offisielle trærOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 3 days
-
Add: Atlas TVOpenchannels:add check:passed
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 4 days