Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Failed to serialize preloaded data... Cannot stringify a function #1

Open
woutdp opened this issue Mar 29, 2021 · 0 comments
Open

Failed to serialize preloaded data... Cannot stringify a function #1

woutdp opened this issue Mar 29, 2021 · 0 comments

Comments

@woutdp
Copy link

woutdp commented Mar 29, 2021

First of all thanks for the project, it's been very helpful!

Problem

When going to an individual blogpost, and refreshing the page so SSR gets triggered, the following warning occurs:

Failed to serialize preloaded data to transmit to the client at the /blog/<slug> route: Cannot stringify a function
The client will re-render over the server-rendered page fresh instead of continuing where it left off. See https://sapper.svelte.dev/docs#Return_value for more information

This is likely caused by:
https://github.com/ryanfiller/sapper-mdsvex-starter/blob/main/src/routes/blog/%5Bslug%5D.svelte#L15

component.default is a function and sapper doesn't know how to serialize this

Effect

This causes some styling to flash.

Reproduce

Go to https://ryanfiller-sapper-mdsvex-starter.netlify.app/blog/mdsvex/ and refresh the page, you'll see a flash where styling isn't applied.

Information

Versions

svelte: 3.35.0 
sapper: 0.29.1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant