-
-
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
Template execution failed: ReferenceError: window is not defined #96
Comments
Preact-cli prerender your view on build step (using SSR technique). So you have 2 ways to solve this:
|
@thangngoc89 thx a lot! |
Question, are we missing anything by adding the no-prerender? |
You might miss out on a little performance boost, but it's minimal. The usefulness of prerendering varies a lot based on what type of app you're building. If you're building a content website and all your content is synchronously available, it'll prerender quite nicely. If you're building something like a messaging application (just an example), prerendering is very unnecessary. Often times pre-rendering these types of applications just gets your loading spinner on the screen a little faster, which is a meager gain. |
@developit i'm trying to use the preact-mdl with the preact-cli template. I'm new to preact/react so this could just be my lack of understanding but when I do the standard |
@endamccormack your issue might not be the same with this issue. Could you open a new issue with full stack trace? FYI, you can require in the if check
|
How can I use a window/document API?
It works fine on dev, but when i run
npm run build
I am gettingTemplate execution failed: ReferenceError: window is not defined
The text was updated successfully, but these errors were encountered: