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.

[Bug] @yarnpkg/doctor Debug Failure path slashes on Windows

See original GitHub issue

Describe the bug

Ran into an interesting error running @yarnpkg/doctor on windows with yarn berry.

➤ YN0001: │ Error: Debug Failure. Expected C:/_p/vic/vicrewards-frontend/package.json === C:\_p\vic\vicrewards-frontend\package.json.
    at attachFileToDiagnostic (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\typescript\lib\typescript.js:18488:18)
    at Object.attachFileToDiagnostics (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\typescript\lib\typescript.js:18520:42)
    at parseJsonText (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\typescript\lib\typescript.js:28509:46)
    at Object.parseSourceFile (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\typescript\lib\typescript.js:28426:32)
    at Object.createSourceFile (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\typescript\lib\typescript.js:28236:29)
    at buildJsonNode (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\@yarnpkg\doctor\lib\cli.js:159:33)
    at async checkForUnmetPeerDependency (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\@yarnpkg\doctor\lib\cli.js:187:26)
    at async processManifest (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\@yarnpkg\doctor\lib\cli.js:227:17)
    at async processWorkspace (C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\@yarnpkg\doctor\lib\cli.js:244:5)
    at async C:\Users\natty\AppData\Local\Temp\xfs-4f0d06d7\dlx-4176\node_modules\@yarnpkg\doctor\lib\cli.js:310:29

To Reproduce

I’m not too sure about reproduction, as this happens in my private repo but not in a fresh new repo so apoloigies for not having a concrete repro. I’m working on an Angular 11 applicaiton, and this also happens in another private repo of mine. In general, I did this:

  • Windows 10
  • yarn set version berry
  • yarn dlx @yarnpkg/doctor

Environment:

  • OS: Windows 10
  • Node version: 15.6.0
  • Yarn version: 2.4.0

Additional context

Works fine on WSL (linux) with the same project.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:21
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
KiruyaMomochicommented, Sep 1, 2021

I also come with this problem. However, the actual issue behind my problem is: my json file is invalid. It’s invalid because I applied eslint on that json file by mistake. After I fixed the file, the problem just disappeared.

So, maybe there is some problems releated to that json file?

However, look like there is also a bug in typescript’s diagnostic logic.

3reactions
davwheatcommented, Apr 11, 2021

@merceyz For me it’s happened on all the projects I’ve attempted to run the doctor on so far within Windows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS 2017 debugger can't handle forward slash path separators
When debugging these binaries VS fails to find the source files. Instead it brings up the Find Source dialog with base\test\run_all_base_unittests.cc displayed.
Read more >
Why does the cmd.exe shell on Windows fail with paths using ...
One can debate whether Windows CMD is "supposed" to support forward slashes. But that last result is a bug! Even if there is...
Read more >
Setting paths to data in Python—ArcGIS Pro | Documentation
When specifying a path, a forward slash (/) can be used in place of a backslash. Two backslashes can be used instead of...
Read more >
Language: Handling file paths on Windows - Puppet
To complicate things further: the Windows file system APIs will accept both the backslash ( \ ) and forward-slash ( / ) in...
Read more >
mysqlnd.debug doesn't recognize absolute paths with slashes
Bug #80115, mysqlnd.debug doesn't recognize absolute paths with slashes ... On Windows, if a log filename given to mysqlnd.debug has a slash ...
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