Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnp: esbuild-wasm@0.15.2 unable to resolve dependencies of a virtual dependency on Windows #2462

Closed
merceyz opened this issue Aug 12, 2022 · 4 comments

Comments

@merceyz
Copy link

merceyz commented Aug 12, 2022

Describe the bug

In a Yarn PnP project on Windows esbuild-wasm@0.15.2 is unable to resolve the dependencies of virtual dependencies.

Verbose log
⬥ [VERBOSE] Resolving import "./foo.js" in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ" of type "entry-point"

  Read 29 entries for directory "C:\\"
  Read 12 entries for directory "C:\\cygwin64"
  Read 9 entries for directory "C:\\cygwin64\\tmp"
  The file "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\package.json" exists
  The file "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.pnp.cjs" exists
    Extracted JSON data from "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.pnp.cjs"
  Read 11 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ"
  Read 11 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ"
  No "browser" map found in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ"
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\foo.js" as a file
    Checking for file "foo.js"
    Found file "foo.js"
  Read 11 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ"
  Primary path is "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\foo.js" in namespace "file"

⬥ [VERBOSE] Resolving import "react-dom" in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ" of type "require-call"

  Read 11 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ"
  Using Yarn PnP manifest from "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.pnp.cjs" to resolve "react-dom"
    Found parent locator: ["tmp.KdF2CNvNxZ", "workspace:."]
    Found parent package at "./"
    Found dependency locator: ["react-dom", "virtual:bb2aaad20870aa5595f22701557bbe9bff1ca1167640667d99d44b3b488699acc501124c2a325d49039f5f9181fa6ff71153a9f11154183b57c55f8ccfb283d1#npm:18.2.0"]
    Found package "react-dom" at "./.yarn/__virtual__/react-dom-virtual-37ae89c54e/0/cache/react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip/node_modules/react-dom/"
    Resolved "react-dom" via Yarn PnP to "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom"
  The import "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom" is being treated as an absolute path
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom" as a file
    Checking for file "react-dom"
    Checking for file "react-dom.tsx"
    Checking for file "react-dom.ts"
    Checking for file "react-dom.jsx"
    Checking for file "react-dom.js"
    Checking for file "react-dom.css"
    Checking for file "react-dom.json"
    Failed to find file "react-dom"
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom" as a directory
    Read 11 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ"
    Read 3 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn"
    Read 3 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0"    
    Read 7 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache"
    Read 2 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip"
    Read 1 entry for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules"
    The file "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json" exists
    Read 12 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom"
    Searching for main fields in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json"
      Did not find main field "browser"
      Did not find main field "module"
      Found main field "main" with path "index.js"
        Checking for "index.js" in the "browser" map in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json"
          Checking for "index.js"
          Checking for "index.js.tsx"
          Checking for "index.js.ts"
          Checking for "index.js.jsx"
          Checking for "index.js.js"
          Checking for "index.js.css"
          Checking for "index.js.json"
          Checking for "index.js/index"
          Checking for "index.js/index.tsx"
          Checking for "index.js/index.ts"
          Checking for "index.js/index.jsx"
          Checking for "index.js/index.js"
          Checking for "index.js/index.css"
          Checking for "index.js/index.json"
        Checking for "./index.js" in the "browser" map in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json"
          Checking for "./index.js"
          Checking for "./index.js.tsx"
          Checking for "./index.js.ts"
          Checking for "./index.js.jsx"
          Checking for "./index.js.js"
          Checking for "./index.js.css"
          Checking for "./index.js.json"
          Checking for "./index.js/index"
          Checking for "./index.js/index.tsx"
          Checking for "./index.js/index.ts"
          Checking for "./index.js/index.jsx"
          Checking for "./index.js/index.js"
          Checking for "./index.js/index.css"
          Checking for "./index.js/index.json"
        Failed to find "index.js"
        Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\index.js" as a file
          Checking for file "index.js"
          Found file "index.js"
      Resolved to "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\index.js" using the "main" field in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json"
  Read 12 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom"
  Primary path is "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\index.js" in namespace "file"

⬥ [VERBOSE] Resolving import "./cjs/react-dom.development.js" in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom" of type "require-call"

  Read 12 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom"
  Read 12 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom"
  Read 13 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs"
  Checking for "cjs/react-dom.development.js" in the "browser" map in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json"
    Checking for "cjs/react-dom.development.js"
    Checking for "cjs/react-dom.development.js.tsx"
    Checking for "cjs/react-dom.development.js.ts"
    Checking for "cjs/react-dom.development.js.jsx"
    Checking for "cjs/react-dom.development.js.js"
    Checking for "cjs/react-dom.development.js.css"
    Checking for "cjs/react-dom.development.js.json"
    Checking for "cjs/react-dom.development.js/index"
    Checking for "cjs/react-dom.development.js/index.tsx"
    Checking for "cjs/react-dom.development.js/index.ts"
    Checking for "cjs/react-dom.development.js/index.jsx"
    Checking for "cjs/react-dom.development.js/index.js"
    Checking for "cjs/react-dom.development.js/index.css"
    Checking for "cjs/react-dom.development.js/index.json"
  Checking for "./cjs/react-dom.development.js" in the "browser" map in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\package.json"
    Checking for "./cjs/react-dom.development.js"
    Checking for "./cjs/react-dom.development.js.tsx"
    Checking for "./cjs/react-dom.development.js.ts"
    Checking for "./cjs/react-dom.development.js.jsx"
    Checking for "./cjs/react-dom.development.js.js"
    Checking for "./cjs/react-dom.development.js.css"
    Checking for "./cjs/react-dom.development.js.json"
    Checking for "./cjs/react-dom.development.js/index"
    Checking for "./cjs/react-dom.development.js/index.tsx"
    Checking for "./cjs/react-dom.development.js/index.ts"
    Checking for "./cjs/react-dom.development.js/index.jsx"
    Checking for "./cjs/react-dom.development.js/index.js"
    Checking for "./cjs/react-dom.development.js/index.css"
    Checking for "./cjs/react-dom.development.js/index.json"
  Failed to find "cjs/react-dom.development.js"
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs\\react-dom.development.js" as a file
    Checking for file "react-dom.development.js"
    Found file "react-dom.development.js"
  Read 13 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs"
  Primary path is "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs\\react-dom.development.js" in namespace "file"

⬥ [VERBOSE] Resolving import "react" in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs" of type "require-call"    

  Read 13 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs"
  Using Yarn PnP manifest from "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.pnp.cjs" to resolve "react"
    Found parent locator: ["tmp.KdF2CNvNxZ", "workspace:."]
    Found parent package at "./"
    Found dependency locator: ["react", "npm:18.2.0"]
    Found package "react" at "./.yarn/cache/react-npm-18.2.0-1eae08fee2-8434e5782c.zip/node_modules/react/"
    Resolved "react" via Yarn PnP to "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react"
  The import "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react" is being treated as an absolute path
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react" as a file
    Checking for file "react"
    Checking for file "react.tsx"
    Checking for file "react.ts"
    Checking for file "react.jsx"
    Checking for file "react.js"
    Checking for file "react.css"
    Checking for file "react.json"
    Failed to find file "react"
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react" as a directory
    Read 3 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn"
    Read 7 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache"
    Read 2 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip"
    Read 1 entry for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules"
    The file "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\package.json" exists
    Read 9 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react"
    Searching for main fields in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\package.json"
      Did not find main field "browser"
      Did not find main field "module"
      Found main field "main" with path "index.js"
        No "browser" map found in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react"
        Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\index.js" as a file
          Checking for file "index.js"
          Found file "index.js"
      Resolved to "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\index.js" using the "main" field in "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\package.json"
  Read 9 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react"
  Primary path is "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\index.js" in namespace "file"

● [DEBUG] Resolving import "scheduler" in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs" of type "require-call"  

  Read 13 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\__virtual__\\react-dom-virtual-37ae89c54e\\0\\cache\\react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip\\node_modules\\react-dom\\cjs"
  Using Yarn PnP manifest from "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.pnp.cjs" to resolve "scheduler"
    Found parent locator: ["tmp.KdF2CNvNxZ", "workspace:."]
    Found parent package at "./"
    Failed to find "scheduler" in "packageDependencies" of parent package
    Searching for a fallback because "enableTopLevelFallback" is true
      Stopping because ["tmp.KdF2CNvNxZ", "workspace:."] is in "fallbackExclusionList"

✘ [ERROR] Could not resolve "scheduler"

    .yarn/__virtual__/react-dom-virtual-37ae89c54e/0/cache/react-dom-npm-18.2.0-dd675bca1c-7c5b915fb7.zip/node_modules/react-dom/cjs/react-dom.development.js:27:24:
      27 │ var Scheduler = require('scheduler');
         ╵                         ~~~~~~~~~~~

  You can mark the path "scheduler" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.

⬥ [VERBOSE] Resolving import "./cjs/react.development.js" in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react" of type "require-call"

  Read 9 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react"
  Read 9 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react"
  Read 10 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\cjs"
  No "browser" map found in directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\cjs"
  Attempting to load "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\cjs\\react.development.js" as a file
    Checking for file "react.development.js"
    Found file "react.development.js"
  Read 10 entries for directory "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\cjs"
  Primary path is "C:\\cygwin64\\tmp\\tmp.KdF2CNvNxZ\\.yarn\\cache\\react-npm-18.2.0-1eae08fee2-8434e5782c.zip\\node_modules\\react\\cjs\\react.development.js" in namespace "file"

1 error

Ref yarnpkg/berry#4732

To Reproduce

Run the following script in something like Git Bash on Windows

cd $(mktemp -d)
yarn init -2
# Fetch a version of Yarn with the fix for https://github.com/evanw/esbuild/issues/2458
yarn set version from sources --branch 4739
yarn config set enableGlobalCache false
yarn add esbuild-wasm@0.15.2 react@18.2.0 react-dom@18.2.0
printf "require('react-dom')" > foo.js
yarn esbuild --bundle --log-level=verbose ./foo.js
@evanw
Copy link
Owner

evanw commented Aug 13, 2022

Heads up that it may take me a while to set up a Windows VM.

@evanw
Copy link
Owner

evanw commented Aug 13, 2022

I believe this is caused by relative paths on Windows using \ instead of /. This should be an easy fix. Up to you whether you want to mention this in the specification or not. I should have foreseen this in hindsight.

@paul-soporan
Copy link

We already kind of mention the fact that For portability reasons [...] all paths must use the unix path format (/ as separators) (in https://yarnpkg.com/advanced/pnp-spec#basic-concepts), but it's in a context where it sounds like it refers only to the PnP manifests and it's easy to overlook it when joining with other paths.

In Yarn we always normalize all paths to the unix format so we don't have to deal with issues like this.

I'll update the spec to better highlight that the specification assumes all paths to be normalized to the unix format.

@paul-soporan
Copy link

Opened yarnpkg/berry#4747.

And thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants