Skip to content
Discussion options

You must be logged in to vote

Hi!

There are several errors on your _app.js preventing your page to render.

  • import React from 'react-dom'

React doesn't need to be imported if you're only willing to use JSX, if you're willing to use something available under React, you need to import it by doing import React from 'react'.

  • Wrong usage of getInitialProps

I don't get what you're trying to achieve here:

  static async getInitialProps({Component, ctx}) {
    const pageProps = Component.getInitialProps ? await Component.getInitialProps(ctx) : {};
     return {pageProps: pageProps};
    }

The only argument getInitialProps receives is the ctx itself. So this line is currently receiving undefined for these destructured values:

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Onibenjo
Comment options

@Onibenjo
Comment options

Answer selected by jamesmosier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #17329 on September 24, 2020 19:55.