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.

Yarn Berry + inspect/debugger mode fails

See original GitHub issue

What version of Next.js are you using?

10.0.5

What version of Node.js are you using?

14.3.0

What browser are you using?

Firefox, but irrelevant

What operating system are you using?

macOS

How are you deploying your application?

Not deployed

Describe the Bug

If you use yarn berry with pnp mode on, and try to add NODE_OPTIONS='--inspect' to your dev command, it crashes.

Expected Behavior

It should run your app with the debugger on.

To Reproduce

  1. Clone https://github.com/osdiab/berry-inspect-nextjs
  2. yarn && yarn dev

Example was created as follows:

  1. yarn create next-app berry-inspect-nextjs
  2. cd berry-inspect-nextjs
  3. yarn set version berry
  4. rm -rf node_modules
  5. yarn
  6. Edit package.json "dev" script to have prefix NODE_OPTIONS='--inspect'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
merceyzcommented, Jan 29, 2021

The repository you’re linking to is empty, but the issue is that you’re overriding the env variable set by Yarn. You need to preserve the original one

NODE_OPTIONS="$NODE_OPTIONS --inspect" next

Or you can tell Yarn to add it for you

yarn run --inspect next

https://yarnpkg.com/cli/run#options-inspect

1reaction
merceyzcommented, Aug 13, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes | Yarn - Package Manager
This error means that this process failed and Yarn cannot successfully figure out which version of the package should be added to your...
Read more >
esproj crashes when running the project using Yarn Berry ...
When we run the project (F5), it crashes with this error: Verbose logs are written to: C:\Users\.....\AppData\Local\Temp\visualstudio-js-debugger.
Read more >
How to debug Jest Tests when using Yarn 2 / Yarn PnP
The usual way to access a binary in yarn 2 of yarn run --inspect-brk jest --runInBand launches a debugging session from the terminal,...
Read more >
Using modern Yarn for deployment with Node.js on Azure App ...
With Yarn 2.x and greater (called Yarn 'Berry') is what is now billed as ... Do not interfere with requests for node-inspector debugging ......
Read more >
JavaScript package managers compared: npm, Yarn, or pnpm?
Yarn Berry goes even further by ditching node_modules completely with its Plug'n'Play (PnP) mode. In this article, we'll cover the following ...
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