Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit c45690d

Browse files
fix(page): cannot read property 'options' of null
checks if the router instance is defined in the plugin configuration, otherwise is not used to prepend the path with the base url closes #72
1 parent 7b7dbdf commit c45690d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/page.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ export default function page (...args) {
3232
} = config
3333

3434
const queryString = getQueryString(route.query)
35-
const needsBase = prependBase && router.options.base
35+
const base = router && router.options.base
36+
const needsBase = prependBase && base
3637

3738
let path = route.path + (transformQueryString ? queryString : '')
38-
path = needsBase ? getBasePath(router.options.base, path) : path
39+
path = needsBase ? getBasePath(base, path) : path
3940

4041
set('page', path)
4142

0 commit comments

Comments
 (0)