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
First of all I'm not 100% sure if this "defect" is caused by Vite or Svelte Kit. But I decided to go for a issue in the svelte kit repo. If this is related to Vite and the Svelte Kit Team cannot handle it, I will definitely open the ticket or transfer the ticket to the other Repo.
Update 07/08/2024:
In the meantime I created an issue for the vite team as well => vitejs/vite#17631.
I created a pnpm workspace including one application which provides a REST API (nestJS) and the second application which includes the svelte kit ui. Furthermore I have packages which includes all shared libraries e.g a lib for the dtos, models. etc.
To be able to reference the models library in the svelte application I added a symlink within the packages.json in the way pnpm wants it to be: "data-access-models": "workspace:*"
So far so could I could use the models and the component was rendered perfectly.
UPDATE 07/08/24: In the meantime I build the shared lib as ES as well as commonJS lib and there is no need for symlinks.
But the issue when using preserveSymlinks set to true still exists.
See Discord for details.
Currently I'm implementing authentication and authorization using Lucia Auth.
So there is the need of redirect a user from my homepage if he/she is not logged in.
So I included following file under routes folder "page.server.ts" and implementing the PageServerLoad Method.
If there is anything missing within the description please let me know.
The text was updated successfully, but these errors were encountered:
msprada
changed the title
Redirects in "PageServerLoad" does result in 500 internal error within in a pnpm workspace if "preserveSymlinks" is used in site.config.ts
Redirects in "PageServerLoad" does result in 500 internal error within in a pnpm workspace if "preserveSymlinks" is used in vite.config.ts
Apr 19, 2024
Describe the bug
First of all I'm not 100% sure if this "defect" is caused by Vite or Svelte Kit. But I decided to go for a issue in the svelte kit repo. If this is related to Vite and the Svelte Kit Team cannot handle it, I will definitely open the ticket or transfer the ticket to the other Repo.
Update 07/08/2024:
In the meantime I created an issue for the vite team as well => vitejs/vite#17631.
I search for similar bugs within the list and for sure within the www, but I could not find any ones.
Maybe it is related to this instance of Redirect Check wich was mentioned here => Redirects in load functions break when running client-side #5952
Situation:
To be able to reference the models library in the svelte application I added a symlink within the packages.json in the way pnpm wants it to be: "data-access-models": "workspace:*"
So I can use this importing in my pages and components "page.svelte":
<script lang="ts"> import { OrderDto } from 'data-access-models'; export let data; const orders: OrderDto[] = data.orders; </script>
Without further changes with in the application this resulted in following error:
To get this working I had to change the vite.config extend the "resolve" part which results in following.
So far so could I could use the models and the component was rendered perfectly.
UPDATE 07/08/24:
In the meantime I build the shared lib as ES as well as commonJS lib and there is no need for symlinks.
But the issue when using preserveSymlinks set to true still exists.
See Discord for details.
Currently I'm implementing authentication and authorization using Lucia Auth.
So there is the need of redirect a user from my homepage if he/she is not logged in.
So I included following file under routes folder "page.server.ts" and implementing the PageServerLoad Method.
If I open my homepage within login into the application the ui shows me a 500 error instead of redirecting me to the /signin route.
Within my server logs I can see following entry:
And if navigating to the url /signin the Signin Screen is shown without any problems.
Reproduction
Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
If there is anything missing within the description please let me know.
The text was updated successfully, but these errors were encountered: