작성
·
369
0
_document.js에 오타가 있는건지 다른데 오타가 있는건지
몰겠어여 알려주시면 감사여
Error: "MyDocument.getInitialProps()" should resolve to an object with a "html" prop set with a valid html string
at Object.renderToHTML (C:\node_bird_44\front\node_modules\next\dist\next-server\server\render.js:338:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
GET / 500 11240.415 ms - 21
[ event ] disposing inactive page(s): /, /_error
https://github.com/hyunsokstar/node_bird_44
답변 1
0
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps, helmet: Helmet.renderStatic() }
}
여기서처럼 앞에 initialProps를 추가해보세요.