goenning / next-applicationinsights

React higher-order component for using Azure Application Insights inside Next.js
MIT License
15 stars 7 forks source link

'getInitialProps' prevents Automatic Static Optimisation #6

Open matt-paul opened 4 years ago

matt-paul commented 4 years ago

Thanks for your work on this. I'm new to Next.js, so please forgive me if I am missing something. However, the use of 'getInitialProps' means that on build, I recieve the following warning

Warning: You have opted-out of Automatic Static Optimization due togetInitialPropsinpages/_app. This does not opt-out pages withgetStaticProps``

Is the getInitialProps method neccesary, or could it be removed?

Thanks

https://github.com/goenning/next-applicationinsights/blob/2e849f69ef7e01138a88e8cace9152295a94e0a4/src/index.ts#L27

shaohaolin commented 3 years ago

+1