Replies: 2 comments 3 replies
-
It is a known issue with Nextjs and Lingui that you need to specify the NODE_ENV=development before running extract. Need to investigate it further but meanwhile that's the only fix I could share :) |
Beta Was this translation helpful? Give feedback.
-
@semoal Any suggestion how to solve this? I can't figure out how to properly configure it. I've tried to make it work with the following configuration:
This probably is somewhat to be expected since we're going above the root directory. Alternative: I've tried to use the @lingui/babel-plugin-extractmessages but this doesn't play nice with nextjs and completely breaks the build. My .babelrc
But this completely breaks my nextjs with errors like:
I thought using the .babelrc loader is preferable but we'd rather not use the babel loader as nextjs 12 is using swc.rs |
Beta Was this translation helpful? Give feedback.
-
Hi there! Awesome package, loving it so far. Running into a few issues, not sure how to properly solve it.
We're using nextjs and have a monorepo setup to allow the reuse of packages. We're transpiling (https://github.com/martpie/next-transpile-modules) our created packages and want to extract all messages from those packages as well (not sure how relevant this is).
Folder structure:
.linguirc
.babelrc
What works
If I run
NODE_ENV=development lingui extract
insideexamples/nextjsproject
it extracts as expected.What doesn't work
"<rootDir>/examples/nextjsproject/**/*.tsx"
.Now if I run the extract again I get:
Not sure what is happening here and what I have to do to make this work? 🤷 Anybody got a guess?
Beta Was this translation helpful? Give feedback.
All reactions