Error when using with metro only
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 40/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, react-native
- Ambito
- build-system, tooling
Direzione di ricerca
Start with the metro.config.js from the linked example repository and reproduce the 'Cannot find module expo/package.json' error by running npm run start. The stack trace points to node_modules/@expo/metro-config/build/transform-worker/utils/moduleMapper.js, so read how that file resolves modules and why it needs expo/package.json. Done means Metro loads a config built from @expo/metro-config without installing the full expo package, or the README is corrected to say otherwise.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
The instructions in the README.md state:
Non-Expo Projects
react-native-css relies on the bundler to process CSS files. Currently only Expo provides a CSS asset pipeline. Since the Expo SDK is modular, you can add this functionality by just using the @expo/metro-config package.
Follow the Expo instructions, but replace the expo package with @expo/metro-config.
When I try this I receive an error:
error Error loading Metro config at: metro.config.js
Cannot find module 'expo/package.json'
Require stack:
- node_modules/@expo/metro-config/build/transform-worker/utils/moduleMapper.js
Is there a specific version of @expo/metro-config I should be using? I'd like to avoid importing all of expo.
Library version
3.0.7
Environment info
System:
OS: Linux 7.0
CPU:
Memory: GB
Shell:
version: 5
path: /bin/sh
Binaries:
Node:
version: 24.15.0
path:
Yarn:
version: 1.22.22
path:
npm:
version: 11.13.0
path:
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java:
version: 17.0.19
path:
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.1.3
wanted: ^20.1.3
react:
installed: 19.2.3
wanted: ^19.2.5
react-native:
installed: 0.85.3
wanted: ^0.85.3
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Steps to reproduce
npx @react-native-community/cli@latest init reactNativeCssExample --version latestnpm i --save-dev react-native-css @expo/metro-config- setup
metro.config.js
const { mergeConfig } = require('@react-native/metro-config');
const { getDefaultConfig } = require('@expo/metro-config');
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {};
module.exports = mergeConfig(
getDefaultConfig(__dirname),
config
);
npm run start
Reproducible example repository
- Lingua principale
- TypeScript
- Stelle
- 166
- Fork
- 45
- Merge medio
- 13g 14h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nativewind/react-native-css
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#545 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#544 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#543 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
nativewind/react-native-css#540 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#538 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di nativewind/react-native-css
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
lichess-org/lila#22324 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature Request] [Web] Expose kvCacheQuantizationBits in the onnxruntime-web WebGPU EP optionsApertaep:WebGPU platform:web quantization
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/onnxruntime#33752 ·
I maintainer di solito rispondono entro 2 giorni
-
[Skill Bug]: entra-agent-id: inaccurate blueprint permission inheritance and parent token sub claimApertabug entra-agent-id
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/GitHub-Copilot-for-Azure#3467 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fix(worker): keep normal prepare waiting states failure-freeForse già presa @LichKing-2234 l’ha presa oggi. Apertaagent:codex priority:P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AgoraIO-Extensions/agent-infra#3745 ·
I maintainer di solito rispondono entro 1 giorno
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framingForse già presa @Eapp1e l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
makecindy/cindy#7973 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno