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
Hello Mr.Cisco,
First of all thank you for the amazing library and I got pointed to it via a video from HuntaByte.
Anyway the main issue is that am receiving an "Invalid URL" error which seems to stem from the redirect. Here is my current simple setup: "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0",
I am using a hook.server.js that reads a cookie and sets an event.locals
My layout.server.js is also wrapped in the loadFlash as shown below:
`import { loadFlash } from 'sveltekit-flash-message/server';
export const load = loadFlash(async({locals}) =>{
let user = locals.user;
console.log("[Layout.server.js ROOT] User:",user);
return{
props: {
user
}
}
});`
After that I have setup a simple if and div in the main home layout.svelte, but the issue comes up in my login page.server.js, where am using the redirect to redirect and send a flash after a succesful login. Below is a snippet
`import {fail} from '@sveltejs/kit';
import {z} from 'zod';
import { redirect } from 'sveltekit-flash-message/server';
} On the redirect it breaks and throws an invalid url, Not even using an absolute url like: http://localhost:5000/, still yields the same:TypeError: Invalid URL`
The text was updated successfully, but these errors were encountered:
I think my issue may now be similar to this: #38 as i am using the svelte cookie API without the append, as i cannot seem to get the flash message back after setting it.
Hello Mr.Cisco,
First of all thank you for the amazing library and I got pointed to it via a video from HuntaByte.
Anyway the main issue is that am receiving an "Invalid URL" error which seems to stem from the redirect. Here is my current simple setup:
"@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0",
I am using a hook.server.js that reads a cookie and sets an event.locals
My layout.server.js is also wrapped in the loadFlash as shown below:
`import { loadFlash } from 'sveltekit-flash-message/server';
export const load = loadFlash(async({locals}) =>{
let user = locals.user;
console.log("[Layout.server.js ROOT] User:",user);
return{
props: {
user
}
}
});`
After that I have setup a simple if and div in the main home layout.svelte, but the issue comes up in my login page.server.js, where am using the redirect to redirect and send a flash after a succesful login. Below is a snippet
`import {fail} from '@sveltejs/kit';
import {z} from 'zod';
import { redirect } from 'sveltekit-flash-message/server';
}
On the redirect it breaks and throws an invalid url, Not even using an absolute url like: http://localhost:5000/, still yields the same:
TypeError: Invalid URL`The text was updated successfully, but these errors were encountered: