Not sure it's a bug or not supported, thought I would appreciate a way to work around this as file names with brackets or exclamation marks are supported by the filesystem.
Additional-struct!-features.md:(undefined) ../vuepress/lib/app/.temp/routes.js
Module not found: Error: Can't resolve '/data/Additional-struct' in '/vuepress/lib/app/.temp'
resolve '/data/Additional-struct' in '/vuepress/lib/app/.temp'
using description file: /vuepress/package.json (relative path: ./lib/app/.temp)
using description file: /data/package.json (relative path: ./Additional-struct)
no extension
/data/Additional-struct doesn't exist
.js
/data/Additional-struct.js doesn't exist
.json
/data/Additional-struct.json doesn't exist
as directory
/data/Additional-struct doesn't exist
Amazing work btw! 馃憤
Thanks for reporting that! since VuePress is based on vue-router and webpack, but:
vue-router uses path-to-regexp as its path matching engine, round brackets is the internal matching tokens.
webpack might has many issues about using exclamation at path: webpack/webpack/issues?=exclamation
Please avoid using !, and you can use - to replace ().
@ulivz Thanks for that link on webpack issues!
Other issue maybe related, if I have a markdown file with index in the name like `Gitter-Room-Index.md', I get an error at build time:
Rendering page: /data/file.html[vuepress] No matching page found for sidebar item "/data/Gitter-Room-Index.md"
[vuepress] No matching page found for sidebar item "/data/Gitter-Room-Index.md"
[vuepress] No matching page found for sidebar item "/data/Gitter-Room-Index.md"
Error rendering /data/file.html:
TypeError: Cannot read property 'match' of undefined
at getHash (vuepress/lib/default-theme/util.js:13:0)
at isActive (vuepress/lib/default-theme/util.js:43:0)
at render (vuepress/lib/default-theme/SidebarLink.vue?61b3:10:0)
at renderWithStyleInjection (vuepress/node_modules/.registry.npmjs.org/vue-loader/15.0.4/node_modules/vue-loader/lib/runtime/componentNormalizer.js:78:0)
at createFunctionalComponent (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:4058:30)
at createComponent (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:4248:12)
at _createElement (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:4418:15)
at createElement (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:4355:10)
at vm._c (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:4487:42)
at server-bundle.js:14480:650
at VueComponent.renderList [as _l] (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:3703:16)
at VueComponent.SidebarGroupvue_type_template_id_325528d9_render (vuepress/lib/default-theme/SidebarGroup.vue?b7ce:1:547)
at VueComponent.Vue._render (/vuepress/node_modules/.registry.npmjs.org/vue/2.5.16/node_modules/vue/dist/vue.runtime.common.js:4542:22)
at renderComponentInner (/vuepress/node_modules/.registry.npmjs.org/vue-server-renderer/2.5.16/node_modules/vue-server-renderer/build.js:7521:25)
at renderComponent (/vuepress/node_modules/.registry.npmjs.org/vue-server-renderer/2.5.16/node_modules/vue-server-renderer/build.js:7491:5)
at RenderContext.renderNode (/vuepress/node_modules/.registry.npmjs.org/vue-server-renderer/2.5.16/node_modules/vue-server-renderer/build.js:7407:5)
Renaming the file to Gitter-Room-Ind.md and no error.
@x8x I repro this. What about a new issue?
So the problem is only if the file name ends with index, if index is inbetween not problem.
Gitter-Room-Index.md -> build failGitter-Room-Index_.md -> build ok@meteorlxy As you confirm, will open a new issue, thank you for checking.
Most helpful comment
Thanks for reporting that! since VuePress is based on
vue-routerandwebpack, but:vue-routeruses path-to-regexp as its path matching engine,round bracketsis the internal matching tokens.webpackmight has many issues about using exclamation at path: webpack/webpack/issues?=exclamationPlease avoid using
!, and you can use-to replace().