You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm that this is a issue rather than a question.
Bug report
Trying to use an async function for additionalPages as described in the docs crashes with the following error:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at Object.parse (path.js:1434:5)
at Object.parse (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/upath/build/code/upath.js:55:33)
at Page.get filename [as filename] (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/Page.js:150:17)
at Page.get strippedFilename [as strippedFilename] (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/Page.js:175:24)
at Page.get slug [as slug] (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/Page.js:161:25)
at Page.buildPermalink (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/Page.js:219:20)
at Page.process (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/Page.js:139:10)
at AppContext.addPage (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/AppContext.js:294:16)
at Promise.all.pluginAPI.options.additionalPages.values.map (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/AppContext.js:108:20)
at Array.map (<anonymous>)
at AppContext.process (/Users/jvennemann/Development/appc/titanium-vuepress-docs/node_modules/@vuepress/core/lib/prepare/AppContext.js:107:53)
Version
v1.0.0-alpha.27
Steps to reproduce
npm i -g vuepress
Create a new plugin with the docs example, e.g. as ./docs/.vuepress/plugins/pages.js
module.exports={asyncadditionalPages(){constrp=require('request-promise');// VuePress doesn't have request library built-in// you need to install it yourself.constcontent=awaitrp('https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md');return[{path: '/readme/',
content
}]}}
Well, it's is in the docs so i was expecting this to work. The plugin should load the content during build and then the page is available just like a local page.
I actually need this to add additional local pages backed by existing markdown files, but in a async way. More precisely just like it is done here only that the pages reside in a different source folder.
I already worked on a fix that enables async functions, which i can provide shortly.
Bug report
Trying to use an async function for
additionalPages
as described in the docs crashes with the following error:Version
v1.0.0-alpha.27
Steps to reproduce
./docs/.vuepress/plugins/pages.js
echo "# Dummy" > ./docs/README.md
vuepress build ./docs
What is expected?
The build runs without error and the additional pages are available
What is actually happening?
The build crashes. See the error above.
Other relevant information
The text was updated successfully, but these errors were encountered: