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

Projects with NPM Dependencies fail on Windows subst drives #8347

Closed
7 tasks done
shawnwildermuth opened this issue May 26, 2022 · 1 comment
Closed
7 tasks done

Projects with NPM Dependencies fail on Windows subst drives #8347

shawnwildermuth opened this issue May 26, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@shawnwildermuth
Copy link

Describe the bug

When using Vite on a drive that is a subst drive. In my example, I have a folder:

This is subst'd to create a new drive letter:

> subst p: D:\courses\ps\Tailwind

I have two repros with a plain Vite Vue project and a Vite React project. Same issue for both. See the logs for what happens when I run on the subst drive (it works on the raw drive fine)

Similar problem on Vue. Notice the paths say .d:/ as the beginning which I think is the issue.

Reproduction

https://github.com/shawnwildermuth/vite-bug

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
    Memory: 40.16 GB / 63.82 GB
  Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @vitejs/plugin-react: ^1.3.0 => 1.3.2
    vite: ^2.9.9 => 2.9.9

Used Package Manager

npm

Logs

P:\vite-bug\vite-subst-bug-react>npm run dev

> vite-subst-bug-react@0.0.0 dev
> vite


  vite v2.9.9 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 387ms.

✘ [ERROR] Could not resolve "./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react/index.js"

    dep:react:1:23:
      1 │ export default require("./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react/index.js");~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react-dom/client.js"

    dep:react-dom_client:1:23:
      1 │ export default require("./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react-dom/client.js");~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react/jsx-dev-runtime.js"

    dep:react_jsx-dev-runtime:1:23:
      1 │ export default require("./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react/jsx-dev-runtime.js");~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4:58:41 PM [vite] error while updating dependencies:
Error: Build failed with 3 errors:
dep:react:1:23: ERROR: Could not resolve "./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react/index.js"
dep:react-dom_client:1:23: ERROR: Could not resolve "./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react-dom/client.js"
dep:react_jsx-dev-runtime:1:23: ERROR: Could not resolve "./D:/courses/PS/Tailwind/vite-bug/vite-subst-bug-react/node_modules/react/jsx-dev-runtime.js"
    at failureErrorWithLog (P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:1603:15)
    at P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:1249:28
    at runOnEndCallbacks (P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:1034:63)
    at buildResponseToResult (P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:1247:7)
    at P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:1356:14
    at P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:666:9
    at handleIncomingPacket (P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:763:9)
    at Socket.readFromStdout (P:\vite-bug\vite-subst-bug-react\node_modules\esbuild\lib\main.js:632:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)

Validations

@sapphi-red
Copy link
Member

duplicate of #4635

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2022
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels May 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants