-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render error when using "$app/state" #49
Comments
Try deleting node_modules, reinstall them and restart VS Code. |
Hi @ciscoheat i did try that already, Things to note idk if it affects it but i tired using both adapter-auto and adapter-node, still that same error pops up. |
Compare with this working example and check for differences: https://www.sveltelab.dev/m24gt8rvhwmthu1?files=.%2Fsrc%2Froutes%2F%2Blayout.svelte%2C.%2Fsrc%2Froutes%2F%2Bpage.server.ts |
Ah i see the problem now. it conflicts with houdini client. Error: Transform failed with 1 error:
/web/src/routes/+layout.server.ts:10:9: ERROR: Multiple exports with the same name "load"
errors: [
{
detail: undefined,
id: '',
location: [Object],
notes: [Array],
pluginName: '',
text: 'Multiple exports with the same name "load"'
}
],
warnings: [],
frame: '\n' +
'\x1B[33mMultiple exports with the same name "load"\x1B[39m\n' +
'8 | }\n' +
'9 | \n' +
'10 | export { load } from "sveltekit-flash-message/server";\n' +
' | ^\n',
loc: {
file: 'web/src/routes/+layout.server.ts',
line: 10,
column: 5
},
plugin: 'vite:esbuild',
id: 'web/src/routes/+layout.server.ts',
pluginCode: 'import { buildSessionObject } from "$houdini/plugins/houdini-svelte/runtime/session";\n' +
'\n' +
'export async function load(event) {\n' +
' return {\n' +
' ...buildSessionObject(event),\n' +
' ...{}\n' +
' };\n' +
'}\n' +
'\n' +
'export { load } from "sveltekit-flash-message/server";',
runnerError: Error: RunnerError When i use this export { load } from 'sveltekit-flash-message/server'; So i opted into using the flash, like this import { loadFlash, flashCookieOptions } from 'sveltekit-flash-message/server';
flashCookieOptions.sameSite = 'lax';
export const load = loadFlash(async () => {}); I think it's doing it's error because this is being overriden by the houdini plugin, because that error went away. Still doing "$app/state" import of page and loading it to flash gives me the original error, but not when importing the page from "$app/store". |
I have similar issue, the $app/store has been deprecated. I am trying to refactor my existing working code, but the code |
Having a similar issue using page from $app/state instead of page from $app/store. If using page from $app/state I don't get the flashing alert I set up unless I refresh the page, or navigate away, however with page from $app/store everything works as is, I assume there's some kind of subscription to be sent to getFlash in order for this to work with $app/state as its the preferred behaviour for svelte 5 |
Versions
The text was updated successfully, but these errors were encountered: