-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Prerender error and workarounds #178
Comments
Had the same issue using |
@nephix I updated the command. So sorry. |
@thangngoc89 what's expected outcome of this issue? Friendly error message with steps how to write code which could be used on node side? I guess we could wrap prerender with try catch block that checks for |
IMO the example app that preact-cli creates should show how to handle the issue if DOM is required on |
@rkostrzewski Yup. A friendly error for user. |
Hi ! I try to prerender the default template with no extra code but it fails.
I'm on macOS Catalina with node 13.6.0 Did i miss something ? |
The issue was coming from node 13.6. I siwtched to 12.6.2 and the prerender is working fine. The only issue that i see now is that the home page seems to not be rendered. I cannot find the html file in the build folder. |
You might want to update to the latest |
Preact-cli comes with prerender which render your
/
route using server-side rendering technique. So if you runnpm start
successfully butnpm run build
produces some errors, this mean that the prerender is failing because of some code requires DOM to work.Workarounds:
npm run build -- --no-prerender
The text was updated successfully, but these errors were encountered: