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

ViteJS build error with symlinked directory from another drive. #10978

Closed
7 tasks done
Joel-Adving opened this issue Nov 18, 2022 · 1 comment
Closed
7 tasks done

ViteJS build error with symlinked directory from another drive. #10978

Joel-Adving opened this issue Nov 18, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@Joel-Adving
Copy link

Joel-Adving commented Nov 18, 2022

Describe the bug

I am trying to run npm run dev / npm run build from inside a symlinked directory on windows, but it fails with the error:
[vite:build-html] The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "E:/Dev/Personal/Sandbox/symlinked/index.html".

The original dir is inside my E: drive, and the symlinked dir is inside the C: drive.
Both create-react-app and create-next-app work flawlessly from inside the symlinked directory.

Reproduction

https://stackblitz.com/edit/vitejs-vite-pf6j6s?file=index.html&terminal=dev

Steps to reproduce

  1. Create a new symlinked directory, mklink /d "C:\symlinked_directory" "E:\directory"
  2. Cd into the symlinked directory
  3. Run npm create vite@latest, select React and Typescript
  4. Cd into the newly created Vite app and Run npm i then npm run build

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 19.06 GB / 31.93 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.674.0), Chromium (107.0.1418.42)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitejs/plugin-react: ^2.2.0 => 2.2.0
    vite: ^3.2.3 => 3.2.4

Used Package Manager

npm

Logs

Click to expand!
> [email protected] build
> tsc && vite build

vite v3.2.4 building for production...
✓ 34 modules transformed.
rendering chunks (1)...[vite:build-html] The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "E:/Dev/Personal/Sandbox/symlinked/index.html".
error during build:
Error: The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "E:/Dev/Personal/Sandbox/symlinked/index.html".
    at error (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at FileEmitter.emitFile (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/rollup/dist/es/shared/rollup.js:22335:24)
    at Object.generateBundle (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:43019:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Bundle.generate (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/rollup/dist/es/shared/rollup.js:15796:9)
    at async file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/rollup/dist/es/shared/rollup.js:23795:27
    at async catchUnfinishedHookActions (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/rollup/dist/es/shared/rollup.js:23126:20)
    at async doBuild (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:45409:22)
    at async build (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:45237:16)
    at async CAC.<anonymous> (file:///E:/Dev/Personal/Sandbox/symlinked/node_modules/vite/dist/node/cli.js:756:9)

Validations

@sapphi-red
Copy link
Member

Duplicate of #10802

@sapphi-red sapphi-red marked this as a duplicate of #10802 Nov 18, 2022
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels Nov 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 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