-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[bug?] Shadow Endpoints fails to hydrate big data sent to their matching page because it is truncated. causing SyntaxError: Unexpected end of JSON input #3773
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
Comments
Works for me on the stackblitz link you sent |
ok verified that when i try the stackblitz in incognito it works. so it just means i've been unable to make a stackblitz repro, because i'm definitely seeing this error locally. the error:
and when i look at that code in start.js it does this if (is_leaf) {
const serialized = document.querySelector('[data-type="svelte-props"]');
if (serialized) {
props = JSON.parse(/** @type {string} */ (serialized.textContent));
}
} when i try to add logs to it it some how truncates weirdly and i wonder if thats the issue, am i sending too much data? |
@sw-yx there are multiple issues on that page, it looks like something with serializing. |
Yeah, I reproduced it on both stackblitz and local, I'll try to debug it. |
JSON.stringify makes a string but then JSON.parse fails to parse it, because because of those html elements in the string, the HTML becomes malformed and it breaks. |
WOW, amazing, thank you so much @PH4NTOMiki ! |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
i originally came to this issue when trying to use shadow endpoints for the first time:
EDIT: there are more discovery points in subsequent comments below.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-ahljwi?file=src/routes/about.svelte
npm run dev
and go to the /about endpoint
Logs
System Info
this is my mac envinfo since stackblitz doesnt seem to be able to run envinfo
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: