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

Warning: You have opted-out of Automatic Static Optimization due to getInitialProps in pages/_app #11

Closed
PabloSzx opened this issue Feb 18, 2020 · 1 comment
Assignees

Comments

@PabloSzx
Copy link

PabloSzx commented Feb 18, 2020

Hi, when using this module you get this message

Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`.
Read more: https://err.sh/next.js/opt-out-auto-static-optimization

Is it possible to use modify this module so this doesn't happen?

@jagaapple jagaapple changed the title arning: You have opted-out of Automatic Static Optimization due to getInitialProps in pages/_app Warning: You have opted-out of Automatic Static Optimization due to getInitialProps in pages/_app Feb 18, 2020
@jagaapple
Copy link
Owner

@PabloSzx
This package needs to access a request object and we can access it in only getInitialProps lifecycle provided by Next.js, so unfortunately it's impossible 😢
If you are creating a static website using Next.js, you have to configure some headers in Express.js layer instead, such as Helmet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants