Vuepress: MD file names with round brackets returns 404, file names with exclamation mark fails to build

Created on 30 Apr 2018  路  5Comments  路  Source: vuejs/vuepress

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.

  • names with round brackets compile fine but returns 404 when called
  • names with exclamation marks fail to compile, error returned for file named 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! 馃憤

Most helpful comment

Thanks for reporting that! since VuePress is based on vue-router and webpack, but:

Please avoid using !, and you can use - to replace ().

All 5 comments

Thanks for reporting that! since VuePress is based on vue-router and webpack, but:

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 fail
  • Gitter-Room-Index_.md -> build ok

@meteorlxy As you confirm, will open a new issue, thank you for checking.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cfjedimaster picture cfjedimaster  路  3Comments

genedronek picture genedronek  路  3Comments

ynnelson picture ynnelson  路  3Comments

herrbischoff picture herrbischoff  路  3Comments

harryhorton picture harryhorton  路  3Comments