Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.
This repository was archived by the owner on May 13, 2024. It is now read-only.

[Bug Report] vuepress-plugin-clean-urls causes build errors when indexSuffix is empty string #18

@killroyboy

Description

@killroyboy

Environment

  • Package version: [email protected]
  • VuePress version: 1.2.0
  • OS: MacOS 10.15.3
  • Browser: Chrome 79.0.3945.130

Describe the bug

I have added an index.html and config.yml file (for NetlifyCMS integration). This works perfectly until I enable the clean-urls plugin. It appears this plugin is attempting to parse them in some way.

Steps To Reproduce

  1. Follow the instructions from here to add the admin/index.html and admin/config.yml
  2. Perform a vuepress build: vuepress build

Results in the following errors when run with --debug (I renamed by "doc" folder to "src"):

$ vuepress build src --debug
debug global_options { theme: '@vuepress/default' }
debug build_options { '--': [], cache: true, debug: true }
wait Extracting site metadata...
debug sourceDir /Users/danwilson/git/graphite/www-site/src
debug Temp directory: /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp
tip Apply local theme at /Users/danwilson/git/graphite/www-site/src/.vuepress/theme...
tip Apply theme local ...
debug theme local /Users/danwilson/git/graphite/www-site/src/.vuepress/theme
debug parentTheme undefined undefined
debug SSR Template File: /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/index.ssr.html
debug DEV Template File: /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/index.dev.html
debug globalLayout: /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/components/GlobalLayout.vue
debug Plugins defined at @vuepress/internal-site-config { '@vuepress/google-analytics': { ga: 'UA-135254752-1' },
  'vuepress-plugin-serve': { port: 8082 },
  'vuepress-plugin-clean-urls': { normalSuffix: '', indexSuffix: '' },
  '@vuepress/search': { searchMaxSuggestions: 10 } }
debug Apply plugin @vuepress/internal-site-data ...
debug Apply plugin @vuepress/internal-routes ...
debug Apply plugin @vuepress/internal-root-mixins ...
debug Apply plugin @vuepress/internal-enhance-app ...
debug Apply plugin @vuepress/internal-palette ...
debug Apply plugin @vuepress/internal-style ...
debug Apply plugin @vuepress/internal-layout-components ...
debug Apply plugin @vuepress/internal-page-components ...
debug Apply plugin @vuepress/internal-transform-modules ...
debug Apply plugin @vuepress/internal-data-block ...
debug Apply plugin @vuepress/internal-frontmatter-block ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
debug [@vuepress/plugin-last-updated] disabled.
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
debug Apply plugin @vuepress/internal-theme-entry-file ...
debug Apply plugin @vuepress/internal-theme-api ...
debug Apply plugin @vuepress/internal-site-config ...
tip Apply plugin @vuepress/google-analytics (i.e. "@vuepress/plugin-google-analytics") ...
tip Apply plugin serve (i.e. "vuepress-plugin-serve") ...
tip Apply plugin clean-urls (i.e. "vuepress-plugin-clean-urls") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
debug applySyncOption: chainMarkdown
debug applySyncOption: extendMarkdown
debug applyAsyncOption: additionalPages
debug applyAsyncOption: ready
debug applyAsyncOption: clientDynamicModules
debug applyAsyncOption: enhanceAppFiles
debug applyAsyncOption: globalUIComponents
debug Cache directory: /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/node_modules/.cache/vuepress
debug Cache identifier : {"vuepress":"1.2.0","cache-loader":"3.0.1","vue-loader":"3.0.1","isProd":true,"config":""}
debug Dist directory: /Users/danwilson/git/graphite/www-site/dist
debug applySyncOption: define
debug applySyncOption: alias
debug applySyncOption: chainWebpack
debug applySyncOption: define
debug applySyncOption: alias
debug applySyncOption: chainWebpack
(undefined) ./src/.vuepress/public/admin/config.yml 8:0
Module parse failed: Unexpected character '#' (8:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   app_id: ************
|
> #publish_mode: editorial_workflow
|
| media_folder: "/src/.vuepress/public/images"
 @ ./src/.vuepress/public sync ^\.\/.*$ ./admin/config.yml
 @ /Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--3-0!/Users/danwilson/.config/yarn/global/node_modules/babel-loader/lib??ref--3-1!/Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danwilson/.config/yarn/global/node_modules/vue-loader/lib??vue-loader-options!./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/app-enhancers/global-components-1.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/internal/app-enhancers.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/app.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/clientEntry.js
 @ multi /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/clientEntry.js
(undefined) ./src/.vuepress/public/admin/index.html 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>
 @ ./src/.vuepress/public sync ^\.\/.*$ ./admin/index.html
 @ /Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--3-0!/Users/danwilson/.config/yarn/global/node_modules/babel-loader/lib??ref--3-1!/Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danwilson/.config/yarn/global/node_modules/vue-loader/lib??vue-loader-options!./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/app-enhancers/global-components-1.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/internal/app-enhancers.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/app.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/clientEntry.js
 @ multi /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/clientEntry.js
(undefined) ./src/.vuepress/public/admin/config.yml 8:0
Module parse failed: Unexpected character '#' (8:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   app_id: ***********
|
> #publish_mode: editorial_workflow
|
| media_folder: "/src/.vuepress/public/images"
 @ ./src/.vuepress/public sync ^\.\/.*$ ./admin/config.yml
 @ /Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--3-0!/Users/danwilson/.config/yarn/global/node_modules/babel-loader/lib??ref--3-1!/Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danwilson/.config/yarn/global/node_modules/vue-loader/lib??vue-loader-options!./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/app-enhancers/global-components-1.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/internal/app-enhancers.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/app.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/serverEntry.js
 @ multi /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/serverEntry.js
(undefined) ./src/.vuepress/public/admin/index.html 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>
 @ ./src/.vuepress/public sync ^\.\/.*$ ./admin/index.html
 @ /Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--3-0!/Users/danwilson/.config/yarn/global/node_modules/babel-loader/lib??ref--3-1!/Users/danwilson/.config/yarn/global/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/danwilson/.config/yarn/global/node_modules/vue-loader/lib??vue-loader-options!./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue?vue&type=script&lang=js&
 @ ./src/.vuepress/components/EndorsementSlide.vue
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/app-enhancers/global-components-1.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/.temp/internal/app-enhancers.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/app.js
 @ /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/serverEntry.js
 @ multi /Users/danwilson/.config/yarn/global/node_modules/@vuepress/core/lib/client/serverEntry.js
wait Rendering static HTML...
Rendering page: error Error rendering : false
undefined
undefined

Screenshots

Expected behavior

Build should be completed without errors.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions