question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug?] Shadow Endpoints fails to hydrate big data sent to their matching page because it is truncated. causing SyntaxError: Unexpected end of JSON input

See original GitHub issue

Describe the bug

i originally came to this issue when trying to use shadow endpoints for the first time:

image

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

9:03:33 PM [vite] hmr update /src/routes/about.svelte

System Info

this is my mac envinfo since stackblitz doesnt seem to be able to run envinfo

  System:
    OS: macOS 11.4
    CPU: (8) x64 Apple M1
    Memory: 51.47 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.4.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.18.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 98.0.4758.80
    Safari: 14.1.1
  npmPackages:
    @sveltejs/adapter-netlify: ^1.0.0-next.44 => 1.0.0-next.44 
    @sveltejs/kit: ^1.0.0-next.260 => 1.0.0-next.260 
    svelte: ^3.44.3 => 3.46.4 

Severity

blocking an upgrade

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
sw-yxcommented, Feb 10, 2022

WOW, amazing, thank you so much @PH4NTOMiki !

0reactions
PH4NTOMikicommented, Feb 9, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error : SyntaxError: Unexpected end of JSON input
Your code is trying to parse an incomplete JSON string, just the first chunk. The most common approach is to declare an array...
Read more >
Fullstack React - dashboard
data flow and interactivity is rigidly defined. In React, when the inputs for a component change, the framework simply re-renders that component.
Read more >
ChangeLog - ftp
pop3: Sending POP3 command with ':' character caused an assert-crash. v2.3.18 ... NULL' failed o Bug 798680 - Not able to match a...
Read more >
Shadow Endpoints In Svelte Kit - Weekly Svelte - YouTube
Our first course drop coming March 3rd https://www.youtube.com/watch?v=LATf_lVYoMQ https://github.com/sveltejs/kit/issues/3532 Sign up for ...
Read more >
wordlist ranked - Massachusetts Institute of Technology
the of and to a in for is on s that by this with i you it not or be are from at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found