Unable to resolve "@lingui/babel-plugin-lingui-macro/macro" from "node_modules/@lingui/core/macro/index.js"
Description
I have trouble running lingui on a fresh expo project. I have
"expo": "~53.0.9",
"@lingui/babel-plugin-lingui-macro": "^5.3.1",
and when I try to bundle my app, it throws:
Android Bundling failed 3158ms node_modules/expo-router/entry.js (3473 modules)
Unable to resolve "@lingui/babel-plugin-lingui-macro/macro" from "node_modules/@lingui/core/macro/index.js"
I also bumped into:
Android Bundling failed 1945ms node_modules/expo-router/entry.js (3566 modules)
The package at "node_modules/@lingui/conf/dist/index.cjs" attempted to import the Node standard library module "path".
but that one I was able to resolve by adding
config.resolver.unstable_enablePackageExports = false
to my metro.config.js
Verifications
- [x] I've checked the docs and this isn't covered there.
- [x] I've searched existing issues on GitHub.
Reproduction Steps
try to run an fresh expo project with lingui
Expected Behavior
it bundles
Macro Support
Babel with babel-macro-plugin
Lingui Version
5.3.1
Babel Version
7.27.1
Framework
Expo
I could not help here without a reproduction repo. It seems like some mess with how bundler / running instance of node (or whatever is used in your setup) is resolving packages
Will create a repro today.
ah it works ok in a fresh repo. I was trying with my components/pages from a legacy react-native app https://github.com/authier-pm/authier/tree/expo-mobile-app/mobile-app
closing, works gr8 with fresh expo, sorry for false alarm
I'm getting the same error on a new project.
node: v20.18.1 react: v19.0.0 expo: v53.0.9
reopen this issue please
Hi, i have the following error with a fresh expo installation.
Android Bundling failed 578ms node_modules\expo-router\entry.js (1293 modules)
The package at "node_modules\babel-plugin-macros\dist\index.js" attempted to import the Node standard library module "path".
It failed because the native React runtime does not include the Node standard library.
Learn more: https://docs.expo.dev/workflow/using-libraries/#using-third-party-libraries
This is my reproduction repo.
This is my local configuration:
node: v22.15.0
expo: "~53.0.9"
react": "19.0.0",
react-dom: "19.0.0",
react-native: "0.79.2"
Step to reproduce the issue:
- yarn install
- yarn start
- open the app with expo go (scan qr code from the cli)
@vonovak could you take a look at this issue? It's related to RN
@mancioshell I installed your repro but wasn't able to reproduce the issue.
Please double-check the repro and open a new issue if the problem persists. Try clearing the metro cache when you run yarn start
Thank you