You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preserveSymlinks option not being sent to esbuild, breaking some execution environments (such as when run from/with junction'd folders on Windows) [fix]
#16197
I've run into this when attempting to run SvelteKit's introductory "SvelteKit demo app" from a folder that is junction'd (symlinked) on Windows. After a failing application (described in Steps to Reproduce below), I took a look around the vite code and was able to get it working. Whether or not the best resolution, this seems most closely related to vitejs/vite, nonetheless.
For my specific situation, these two locations require preserveSyminks to be set to true (as it is currently, the code is hardcoded to fail):
Line 1100 goes to the externalize-deps plugin (via tryNodeResolve) and
At line 1063, above it needs to be among the options, which get fed into esbuild (flagsForBuildOptions):
(Incidentally and importantly, for eventual configuration/fix purposes: it seems these code locations are hit before either svelte.config.js or vite.config.ts are ever read)
Seems like this would not affect only Windows, but I don't know:
Some other issues that might be related: (no idea). #16176 #10802
#run from a junction'd windows directory (ie example, CWD is folder C:\project that is a junction pointing to D:\real_project):
npm create svelte@latest my-app
cd my-app
npm install
npm run dev ----open
...
#choose SvelteKit demo app, be navigated to the opened localhost url, then get to a broken application page with the console error:
The request url "D:/real_project/my-app/node_modules/@sveltejs/kit/src/runtime/client/entry.js" is outside of Vite serving allow list.
# to work the PATH needs to start with C:/project, remaining unresolved
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
This started happening to me after a node_modules reinstall this week. It seems like maybe some sveltejs files aren't being whitelisted anymore. My workaround was to update server.fs.allow in vite.config.ts:
allow=[...,'<path to node_modules>/@sveltejs/kit/src/runtime']
Edit: My build environment is git bash on Windows.
Describe the bug
I've run into this when attempting to run SvelteKit's introductory "SvelteKit demo app" from a folder that is junction'd (symlinked) on Windows. After a failing application (described in Steps to Reproduce below), I took a look around the vite code and was able to get it working. Whether or not the best resolution, this seems most closely related to vitejs/vite, nonetheless.
For my specific situation, these two locations require preserveSyminks to be set to true (as it is currently, the code is hardcoded to fail):
vite/packages/vite/src/node/config.ts
Line 1100 in 72104f6
vite/packages/vite/src/node/config.ts
Line 1063 in 72104f6
Line 1100 goes to the externalize-deps plugin (via tryNodeResolve) and
At line 1063, above it needs to be among the options, which get fed into esbuild (flagsForBuildOptions):
https://github.com/evanw/esbuild/blob/9d1777f23d9b64c186345223d92f319e59388d8b/lib/shared/common.ts#L225
(Incidentally and importantly, for eventual configuration/fix purposes: it seems these code locations are hit before either svelte.config.js or vite.config.ts are ever read)
Seems like this would not affect only Windows, but I don't know:
Some other issues that might be related: (no idea).
#16176
#10802
Reproduction
https://kit.svelte.dev/
Steps to reproduce
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: