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

Markdown image not found when file name contains a space #11291

Closed
1 task
mossymaker opened this issue Jun 19, 2024 · 0 comments · Fixed by #11310
Closed
1 task

Markdown image not found when file name contains a space #11291

mossymaker opened this issue Jun 19, 2024 · 0 comments · Fixed by #11310
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: assets Related to the Assets feature (scope)

Comments

@mossymaker
Copy link

Astro Info

Astro                    v4.10.3
Node                     v20.5.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/starlight

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When a markdown document includes an image with a space in the filename, Astro reports "image not found".

src/content/docs/reference/network/System Diagram.md

---
title: System Diagram
---

![Network Diagram](../../../../assets/Network%20Diagram.svg)

If the file is renamed to remove the space and the path is updated, Astro finds the image.

Here's the trace:

ImageNotFound: Could not find requested image `../../../../assets/Network%20Diagram.svg`. Does it exist?
    at LoadPluginContext.load (file:///Users/.../node_modules/astro/dist/assets/vite-plugin-assets.js:179:19)
    at async PluginContainer.load (file:///Users/.../node_modules/vite/dist/node/chunks/dep-BcXSligG.js:49511:22)
    at async loadAndTransform (file:///Users/.../node_modules/vite/dist/node/chunks/dep-BcXSligG.js:52306:22)
    at async instantiateModule (file:///Users/.../node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53309:44)

What's the expected result?

Astro is able to build markdown pages when an image's filename contains spaces.

Link to Minimal Reproducible Example

https://stackblitz.com/github/mossymaker/astro-filename-space-bug

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jun 19, 2024
@ematipico ematipico added - P4: important Violate documented behavior or significantly impacts performance (priority) feat: assets Related to the Assets feature (scope) and removed needs triage Issue needs to be triaged labels Jun 20, 2024
@bluwy bluwy self-assigned this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: assets Related to the Assets feature (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants