Skip to content

Commit

Permalink
better error message when component is a promise (fix vuejs#3167)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSiefke committed Apr 16, 2020
1 parent 11e779a commit 011417b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/create-route-map.js
Expand Up @@ -70,6 +70,12 @@ function addRouteRecord (
path || name
)} cannot be a ` + `string id. Use an actual component instead.`
)
assert(
route.component.toString() !== '[object Promise]',
`route config "component" for path: ${String(
path || name
)} cannot be a promise. Use a function that returns a promise instead (e.g. \`() => import ('./components/About.vue')\`)`
)
}

const pathToRegexpOptions: PathToRegexpOptions =
Expand Down

0 comments on commit 011417b

Please sign in to comment.