`react-dom/server` cannot be resolved with `unstable_enablePackageExports` and condition `browser`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- tooling
Research direction
Start by reproducing the react-dom/server resolution with unstable_enablePackageExports and the shown browser condition. Inspect the package.json exports and browser mappings, including server.browser.js; done when Metro resolves the import without the fallback warning.
Written by the indexing model from the issue text.
Description
(As reported by @EvanBacon)
Metro cannot resolve react-dom/server with unable_enablePackageExports (and condition browser?), reporting:
warning: Attempted to import the module "/Users/evanbacon/Documents/GitHub/expo/node_modules/react-dom/server.browser.js" which is not listed in the "exports" of "/Users/evanbacon/Documents/GitHub/expo/node_modules/react-dom". Falling back to file-based resolution. Consider updating the call site or asking the package maintainer(s) to expose this API.
Conditions
unstable_conditionNames: [ 'node', 'require' ],
unstable_conditionsByPlatform: { web: [ 'browser' ] },
package.json
"exports": {
".": "./index.js",
"./client": "./client.js",
"./server": {
"deno": "./server.browser.js",
"worker": "./server.browser.js",
"browser": "./server.browser.js",
"default": "./server.node.js"
},
"./server.browser": "./server.browser.js",
"./server.node": "./server.node.js",
"./profiling": "./profiling.js",
"./test-utils": "./test-utils.js",
"./package.json": "./package.json"
},
"browser": {
"./server.js": "./server.browser.js"
},
- 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
-
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
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4547 · 3 comments ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
githubnext/gh-aw-workshop#4090 ·
Maintainers usually reply within 1 day
-
bug deck: add to staging level: missing p-feature: Manage Submissions p-feature: Submissions and process priority: MUST HAVE ready for dev lead role: missing size: missing time sensitive
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
hackforla/tdm-calculator#3581 ·
Maintainers usually reply within 2 days