Skip to content

"handleError" is not exported by "src/hooks.client.ts" #12737

Discussion options

You must be logged in to vote

To remove this you have to create three files.

/src/hooks.client.js
/src/hooks.server.js
/src/hooks.js

Then copy this code to hooks.client.js:

` /** @type {import('@sveltejs/kit').HandleServerError} */
export async function handleError({ error, event, status, message }) {	
return {};
}`

Then copy this code to hooks.js

` /** @type {import('@sveltejs/kit').Reroute} */ 
export function reroute({ url }) {}`

hooks.server.js can be left empty, but it is also an entrypoint for some use cases, so create it now - some times you will need it. :-)

Both of these codes do currently nothing, but can be filled some day with logic when needed.

Further information can be found on the Svelte Documentati…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@orangecoloured
Comment options

@alexander-vidoni
Comment options

Answer selected by orangecoloured
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants