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 working with pnpm

See original GitHub issue

pnpm is an alternative package manager.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Should work.

Current Behavior

npm run build

> vwp@1.0.0 build /Users/Vaughan/dev-live/vwp
> next build

> Failed to build on /var/folders/kp/06ys69nn6hq9k23cv0xxn19m0000gn/T/f445f6d8-80e8-4d8d-8946-d62056f4ddb7
{ Error: ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry
Module not found: Error: Can't resolve '../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js' in '/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages'
resolve '../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js' in '/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages'
  using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)
    using description file: /Users/Vaughan/dev-live/vwp/package.json (relative path: ./.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json doesn't exist
      as directory
        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn't exist
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js]
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json]
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]
 @ ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry 3:17-118
 @ multi ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry
    at /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/build/index.js:182:21
    at emitRecords.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/tapable/0.2.8/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/tapable/0.2.8/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:360:15)
  errors:
   [ './node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry\nModule not found: Error: Can\'t resolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\nresolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\n  using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n    Field \'browser\' doesn\'t contain a valid alias configuration\n  after using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n    using description file: /Users/Vaughan/dev-live/vwp/package.json (relative path: ./.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js)\n      no extension\n        Field \'browser\' doesn\'t contain a valid alias configuration\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn\'t exist\n      .js\n        Field \'browser\' doesn\'t contain a valid alias configuration\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js doesn\'t exist\n      .json\n        Field \'browser\' doesn\'t contain a valid alias configuration\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json doesn\'t exist\n      as directory\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn\'t exist\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]\n @ ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry 3:17-118\n @ multi ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry',
     './node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_document.js?entry\nModule not found: Error: Can\'t resolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\nresolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\n  using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n    Field \'browser\' doesn\'t contain a valid alias configuration\n  after using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n    using description file: /Users/Vaughan/dev-live/vwp/package.json (relative path: ./.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js)\n      no extension\n        Field \'browser\' doesn\'t contain a valid alias configuration\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js doesn\'t exist\n      .js\n        Field \'browser\' doesn\'t contain a valid alias configuration\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.js doesn\'t exist\n      .json\n        Field \'browser\' doesn\'t contain a valid alias configuration\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.json doesn\'t exist\n      as directory\n        /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js doesn\'t exist\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.json]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js]\n @ ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_document.js?entry 3:17-124\n @ multi ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_document.js?entry' ],
  warnings: [] }

Steps to Reproduce (for bugs)

  1. mkdir foo && cd foo
  2. npm init -y
  3. pnpm i react react-dom next
  4. npm run build

Context

Your Environment

Tech Version
next 3.0.6
node 8.1.2
OS macOS
browser
etc

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arunodacommented, Aug 28, 2017

I’ve tried pnpm with some other packages. Sometimes it works and sometimes it wont. We don’t do anything specific with NPM and modules. So, this is not something we can handle.

0reactions
lock[bot]commented, May 10, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

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 >
Issues · pnpm/pnpm - GitHub
Cannot authenticate to Github repo during the installation pr... Have a question about this project?
Read more >
pnpm/pnpm - Gitter
Is anyone else having issues with pnpm and nextjs/react? Up until recently, I could easily use pnpm init next-app , blow away the...
Read more >
How to fix "postbuild" and "prebuild" not working with pnpm?
I found out this issue on Github mentionning the same problem I encountered. It seems that pre/posts scripts are not activated if using...
Read more >
WSL2: Packages installed using pnpm not detected - YouTrack
Create empty node project, then install any packages using pnpm. You'll see that they are not detected as installed and prompt to install...
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