question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not compatible with PNPM

See original GitHub issue

I’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:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dmyliancommented, Sep 14, 2022

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?

0reactions
hughlvcommented, May 27, 2022

Great. Looking forward to that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found