Skip to content
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

Loading Root Page via SSR ends up in SyntaxError: Unexpected end of JSON input #33

Closed
hrgui opened this issue Jun 8, 2021 · 2 comments

Comments

@hrgui
Copy link
Contributor

hrgui commented Jun 8, 2021

https://pokedex-vitedge.hrgui.workers.dev/ leads to error 1101

In wrangler dev:

Uncaught
SyntaxError: Unexpected end of JSON input
Uncaught (in promise)
SyntaxError: Unexpected end of JSON input
Uncaught (in response)
SyntaxError: Unexpected end of JSON input

While https://pokedex-vitedge.hrgui.workers.dev/pokemon/1 works, then navigating home works also. However, refreshing the page there doesn't work.

See https://github.com/hrgui/pokedex-vitedge for repo

  1. yarn && yarn build in root
  2. npm install && wrangler dev in workers-site
@frandiox
Copy link
Owner

frandiox commented Jun 8, 2021

This was because home route was trying to request props but there was no handler for that. It should now skip it if there is no handler 👍 (0.13.2)

@frandiox
Copy link
Owner

frandiox commented Jun 8, 2021

@hrgui Apart from that, there are some dependency issues in your project:
I think you need to remove all the dependencies and devDependencies from workers-site/package.json (it will grab them from the parent directory), and then move react-helmet-async, react-router-config and react-router-dom to dependencies from devDependencies in the root package.json. It's also missing @types/react-router-dom dev dependency. Tell me if that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants