Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Hide Warning about Automatic Static Optimization #35949

Closed
wuifdesign opened this issue Apr 6, 2022 · 0 comments
Closed

Hide Warning about Automatic Static Optimization #35949

wuifdesign opened this issue Apr 6, 2022 · 0 comments

Comments

@wuifdesign
Copy link

Describe the feature you'd like to request

A setting to hide following warning:

Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps`
Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization

`You have opted-out of Automatic Static Optimization due to \`getInitialProps\` in \`pages/_app\`. This does not opt-out pages with \`getStaticProps\``

I know i use it and i use it because i have to as i need to get settings from api on each call. So i just want to disable this warning. For me, too many warnings during build just hides the relevant warnings.

Describe the solution you'd like

Maybe a setting in next.config.js for all warnings to disable them. Maybe it can also be used to throw an error instead of warning if wanted (if someone wants to):

const nextConfig = {
  warnings: {
    staticOptimization: 'off' | 'warn' | 'error',
    ...
  }
}

Describe alternatives you've considered

it may also be changed using a setting in the .env file

@vercel vercel locked and limited conversation to collaborators Apr 6, 2022
@ijjk ijjk converted this issue into discussion #35950 Apr 6, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant