Unverified Commit 4be6a521 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Make sure we show a nice message when there is no default export (#3400)

parent 48ed89f9
...@@ -199,6 +199,11 @@ export default class Router { ...@@ -199,6 +199,11 @@ export default class Router {
} }
const { Component } = routeInfo const { Component } = routeInfo
if (typeof Component !== 'function') {
throw new Error(`The default export is not a React Component in page: "${pathname}"`)
}
const ctx = { pathname, query, asPath: as } const ctx = { pathname, query, asPath: as }
routeInfo.props = await this.getInitialProps(Component, ctx) routeInfo.props = await this.getInitialProps(Component, ctx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment