nextjs: version 2.2.0
When I used _document.js
like document mentioned. I have this issue. Is there any solution for this case?
I tried some examples using _document.js
. It is still the same
@nndung179 is it possible to have a repo with a way for us to reproduce?
node version: 6.5.0
Hi @arunoda
Here is an example:
https://github.com/zeit/next.js/tree/master/examples/with-external-scoped-css
@arunoda I try this example using "next": "2.2.0" works fine.
But using "next": "latest", installs "2.3.0-alpha1", and tends to fail.
Adding this in _document.js works fine. source
```javascript
static getInitialProps ({ renderPage }) {
const {html, head, chunks} = renderPage()
return { html, head , chunks}
}
This problem will occur when nextjs version is 2.3-alpha1,
working good when 2.2.0
I assume this is same as this one: https://github.com/zeit/next.js/issues/2435
Always, try to add the correct stuff for getInitialProps of the custom docs. (Always refer to docs)
Or use this:
import Document from `next/document`
static getInitialProps (ctx) {
return Document.getInitialProps(ctx)
}
Most helpful comment
This problem will occur when nextjs version is 2.3-alpha1,
working good when 2.2.0