Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included image filename contains space will make build fail #2596

Closed
4 tasks done
Jeff-Tian opened this issue Jul 9, 2023 · 1 comment
Closed
4 tasks done

Included image filename contains space will make build fail #2596

Jeff-Tian opened this issue Jul 9, 2023 · 1 comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@Jeff-Tian
Copy link
Contributor

Describe the bug

In dev mode, both image filenames contain space or not will serve fine:

image

But the build will fail when met the image assets whose filename contains space:

image

Reproduction

See https://stackblitz.com/edit/vite-upxxuh?file=docs%2Fbook%2Fresources%2Ftest%20(1).svg,docs%2Findex.md,docs%2Fbook%2Fresources%2Ftest.svg,

add a image filename contains space and build.

Expected behavior

Build should succeed.

Ideally should decodeURIComponent when converting ![](image%20(1).png] to code.

So the converted code should be like import image from "image (1).png" instead of import image from "image%20(1).png".

System Info

❯ npx envinfo --system --npmPackages vitepress --binaries --browsers


Need to install the following packages:
  envinfo@7.10.0
Ok to proceed? (y) y

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.3 - /usr/local/bin/pnpm
  npmPackages:
    vitepress: v1.0.0-beta.5 => 1.0.0-beta.5

Additional context

No response

Validations

@Jeff-Tian Jeff-Tian added the bug: pending triage Maybe a bug, waiting for confirmation label Jul 9, 2023
@brc-dd
Copy link
Member

brc-dd commented Jul 9, 2023

Duplicate of #573

@brc-dd brc-dd marked this as a duplicate of #573 Jul 9, 2023
@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2023
Jeff-Tian added a commit to Jeff-Tian/core that referenced this issue Jul 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2023
yyx990803 pushed a commit to vuejs/core that referenced this issue Oct 20, 2023
By decoding them before generating them as JavaScript import paths

fix vuejs/vitepress#2596
fix vuejs/vitepress#573
yyx990803 pushed a commit to vuejs/core that referenced this issue Oct 21, 2023
By decoding them before generating them as JavaScript import paths

fix vuejs/vitepress#2596
fix vuejs/vitepress#573
lumozx pushed a commit to lumozx/core that referenced this issue Oct 21, 2023
By decoding them before generating them as JavaScript import paths

fix vuejs/vitepress#2596
fix vuejs/vitepress#573
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants