Not compatible with PNPM
See original GitHub issueI’m encountering this issue when switching from yarn to pnpm:
https://nextjs.org/docs/messages/module-not-found
wait - compiling...
error - ./node_modules/.pnpm/registry.npmmirror.com+next-export-i18n@2.0.3_c0abbb53577d424fe320649841fdc7d4/node_modules/next-export-i18n/index.js:5:0
Module not found: Can't resolve './../../i18n/index.js'
By reading the source code, the issue is that next-export-i18n assumed it would always be located as <project_folder>/node_modules/next-export-i18n. This is no longer true with pnpm, as it utilized the hard link feature so next-export-18n would be in another location.
I’m still investigating pnpm whether there is solution to make certain package as an exception. No clue yet…
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Frequently Asked Questions - PNPM
pnpm does not work with <YOUR-PROJECT-HERE>?. In most cases it means that one of the dependencies require packages not declared in package.json ....
Read more >pnpm 7.0.0 is not compatible with husky · Issue #4657 - GitHub
It seems that an error is raised if you're using husky and pnpm . husky is a library to add hooks with git...
Read more >PNPM Compatibility DB - Rush.js
Both Yarn and PNPM support a feature called the Compatibility DB, which is a public database of package.json fixups. These fixups solve known...
Read more >pnpm/pnpm - Gitter
ERROR The current version of pnpm is not compatible with the available node_modules structure Run pnpm install --force to recreate node_modules.
Read more >Switching an NX repo to use PNPM - Medium
PNPM does not hoist all dependencies into your node_modules root, this means if the package.json doesn't reference a dependency that your code require()'s ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, looks like the expectation of locale folder location makes it incompatible with the monorepo setup as well, where you have the i18 folder not in
./../../i18n/index.js
, but in./../../apps/consumer-app/i18n/
. The compat fix for pnpm would probably make this problem go away. As @hughlv noted, hardcoding the config path is probably a bit dangerous. Any chance you found a workaround?Great. Looking forward to that.