-
-
Notifications
You must be signed in to change notification settings - Fork 372
Closed
Labels
Description
Preact-cli comes with prerender which render your / route using server-side rendering technique. So if you run npm start successfully but npm run build produces some errors, this mean that the prerender is failing because of some code requires DOM to work.
Workarounds:
- Wrap your with this to make sure it won't execute when prerendering.
if (typeof window !== "undefined") {
// Your code here
}
- Turn off preredering by run
npm run build -- --no-prerender
redstrike and tt-info