Replies: 2 comments
-
Were you ever able to find a solution to this, @dimisus? |
Beta Was this translation helpful? Give feedback.
-
Hey folks, wanted to swing back here with an update. After digging through many different issues and discussions, I've made a new page in the documentation (PR) specifically for Content Security Policy and nonces. This docs page:
Further, we've patched some bugs and made improvements to Really hope this helps out, thank you all 🙏 I'll be closing this discussion out. To continue the discussion, please go here. |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
The static 404 page might be a good idea but in my use case I do not want it and NetxJS forces me to have one.
I mainly use getServerSideProps in my application and leverage the request from context to auth the user on every request by hydrating my store with next-redux-wrapper. Thus getStaticProps is not an option for me.
A mainLayout is used which is as well depending on the getServerSideProps to be displayed correctly (yes, on each request even if it is 404 page). For example I have a currency/language selection and user logged in-out logic within my header navigation which needs to be hydrated on the server side.
I use CSP (content security policy) with nonce by using the custom server setup / helmet and again the req from context to set the headers and the nonce (and utilise it within _app.js and _document.js). Cannot be done with getStaticProps.
Describe the solution you'd like
Either disable the constraint of a statically prerendered 404 page by default or add some config flag to opt-out.
Describe alternatives you've considered
I just want to use getServerSideProps within my _error.js component.
I am ok with the additional load.
An alternative for me would be to change my application's architecture entirely in order to statically generate a 404 page.
Beta Was this translation helpful? Give feedback.
All reactions