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

Next 9 warns opted-out Automatic Prerendering #54

Closed
Tanapruk opened this issue Sep 15, 2019 · 3 comments
Closed

Next 9 warns opted-out Automatic Prerendering #54

Tanapruk opened this issue Sep 15, 2019 · 3 comments

Comments

@Tanapruk
Copy link

Based on your example next example,
The example is using getInitialProps,this gets warn.

Warning: You have opted-out of Automatic Prerendering due to `getInitialProps` in `pages/_app`.

 Read more: https://err.sh/next.js/opt-out-automatic-prerendering

Is there anyway to comply with the warning?

Thanks,

@quentin-sommer
Copy link
Owner

Hi,

This library dynamically detect the user agent when the pages are rendered. It is not possible to pre-render the pages before because there is no way to know what the user-agent of the visiting users will be. So in short: it is not possible to comply with the warning

If you want to pre-render a next.js page you won't be able to use this library on the page.

Hope this answers your question!

@Tanapruk
Copy link
Author

Thank you for answering me.

Prerendering is before knowing what is the loading user agent is. If we render after knowing the user agent then it is not a prerender. One way or another then.

@quentin-sommer
Copy link
Owner

quentin-sommer commented Sep 16, 2019

You could use it only client side without server-side rendering if it works for your use case

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