Skip to content

Clean urls generate files without extension and crashes #2420

Closed
@davidgiga1993

Description

@davidgiga1993
  • I confirm that this is an issue rather than a question.

Bug report

When using the clean-url plugin and setting both suffixes to '' the vuepress build docs command will fail under certain conditions and provide files with no extension

Steps to reproduce

  1. Use the vuepress-plugin-clean-urls plugin, set both suffixes to ''.
  2. Create a page called test.md and a file test/sub.md
  3. Run build

What is expected?

The output files should always have a .html extension as any further URL rewrites must be handled by the webserver anyways. If this change would break any other things I'm not aware of it should be possible to configure a forceExtension option.
This change would also resolve the crash.

This change must be made in the core thus I created the issue here

What is actually happening?

Vue tries to render test.md as test and test/sub.md as test/sub which causes a crash since test is a file and not a directly

Other relevant information

  • Output of npx vuepress info in my VuePress project:

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz
  Binaries:
    Node: 10.16.0 - D:\Development\nodejs\node-v8.11.2-win-x64\node.EXE
    Yarn: Not Found
    npm: 6.9.0 - D:\Development\nodejs\node-v8.11.2-win-x64\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
  npmPackages:
    @vuepress/core:  1.5.0
    @vuepress/theme-default:  1.5.0
    vuepress: ^1.5.0 => 1.5.0
  npmGlobalPackages:
    vuepress: Not Found

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