Skip to content

Instantly share code, notes, and snippets.

@JurrianFahner
Last active March 24, 2024 16:37
Show Gist options
  • Save JurrianFahner/7b40efd3ed40df4c7a1774d5a906f250 to your computer and use it in GitHub Desktop.
Save JurrianFahner/7b40efd3ed40df4c7a1774d5a906f250 to your computer and use it in GitHub Desktop.
Reproduce symlink issue for vite
  1. create base folder

    cd $env:TEMP
    mkdir without-symlink-dir-vue-1231
    cd without-symlink-dir-vue-1231
  2. bootstrap vite vanilla project

    npm create vite@latest my-app -- --template vanilla
  3. build it and run it -> should run without problems

    cd my-app
    npm install
    npm run dev
  4. go back to the temp dir

    cd $env:TEMP
  5. become administrator

    Start-Process pwsh –Verb RunAs
  6. create symlink

    New-Item -Path symlink-path-vue -ItemType SymbolicLink -Value $env:TEMP\without-symlink-dir-vue-1231

Warning

make sure you close the admin terminal and return to the previous terminal

  1. now run it in the symlink path -> this will not run (after visiting http://localhost:5173/ in the browser)
    cd $env:TEMP\symlink-path-vue\my-app\
    npm run dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment