Request: add debug log warning if preserveSymlinks
is set to true
in vite config
#12597
Labels
preserveSymlinks
is set to true
in vite config
#12597
Describe the problem
When
preserveSymlinks
is set to true, depending on the resolved node_modules layout, you can end up with sveltekit classes constructed from client code using one symlink that are then handled by the server process running from a separate symlink. This means thatinstanceof
checks fail and internals for handling oferror()
,redirect()
etc all return generic error messages. For a related issue, see: #12139Supporting running under
preserveSymlinks
I assume is difficult since the vanilla js operations for determining identity no longer work, but we could at least add a warning in the debug log for this case. I spent multiple hours trying to figure out why my redirects were no longer working, only to realize that resolved symlinks from a previous package update resulted in this issue appearing in my project.From logging I put inside sveltekit's
render_page
, with a redirect thrown from aload
function:Describe the proposed solution
Vite config handling in https://github.com/sveltejs/kit/blob/main/packages/kit/src/exports/vite/index.js already outputs to the log if there are options set that are overridden by sveltekit. It would be great to have a warning output if
preserveSymlinks
is set to true to indicate that some sveltekit internal operations such as handling of throwables for http responses may not work in this situation.Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: