stereobooster / react-snap

šŸ‘» Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.04k stars 391 forks source link

pageerror at /: SyntaxError: Unexpected token < in JSON at position 0 #449

Open krzywiecki opened 4 years ago

krzywiecki commented 4 years ago

Bug Report

Current Behavior Generating pages doesn't work when trying to run postbuild script after some time.

The issue is very weird to me. Right after I've installed react-snap package it worked like a charm meaning it was generating static pages and putting it to my /build folder. After some times and a few more tries it started throwing the following error:

šŸ”„  pageerror at /: SyntaxError: Unexpected token < in JSON at position 0

šŸ’¬  console.log at /: Content is cached for offline use.
šŸ’¬  console.log at /: This web app is being served cache-first by a service worker. To learn more, visit https://goo.gl/SC7cgQ
āœ…  crawled 18 out of 18 (/)

image

Node: v8.16.0 NPM: v6.4.1

Sadly I have no way to provide reproducible example as the repo is private. I tried to make code of my app as simple as possible but it didn't help really.

My index.js file: image

my public.index.html file (template) image

I've tried to clear cache, reinstall all dependencies, redeploy page. My only assumption is that there is some problem with cache but no clue what exactly. I'd appreciate every hint as I'm struggling with it from 12h šŸ˜¤

UPDATE: I just open my laptop after 3h break, ran npm run postbuild and it worked again.