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

docusaurus serve crashes if filename contains non ASCII-Characters #10665

Open
6 of 7 tasks
fmabap opened this issue Nov 10, 2024 · 2 comments
Open
6 of 7 tasks

docusaurus serve crashes if filename contains non ASCII-Characters #10665

fmabap opened this issue Nov 10, 2024 · 2 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.

Comments

@fmabap
Copy link

fmabap commented Nov 10, 2024

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Hi,

I have a markdown page that conatins an image. The filename of the image contains german special characters (umlauts) like äöü. When I open the page then the server crashes.

Maybe this is related to the issue #8124

Please find the details below.

Can you please fix it?

Best regards
Frank

Reproducible demo

No response

Steps to reproduce

Create a markdown page that links to an existing image with filename image_äöü.png
Here is an example:

# Test 123

![test](image_äöü.png)

run
npm run build
npm run serve

Click on the page in the browser

Expected behavior

The image will be shown.

Actual behavior

The page is shown, without the image and the server crashes with the following error:

image

image

Your environment

  • Docusaurus version used: 3.6.1
  • Environment name and version ( Chrome 130, Node.js v22.11.0):
  • Operating system and version (e.g. Windows 11):

Self-service

  • I'd be willing to fix this bug myself.
@fmabap fmabap added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Nov 10, 2024
@fmabap fmabap changed the title Docusaurus crashes if markdown image filename contains non ASCII Character Docusaurus crashes if markdown image filename contains non ASCII-Characters Nov 10, 2024
@slorber
Copy link
Collaborator

slorber commented Nov 11, 2024

This is a bug in docusaurus serve, and shouldn't happen if you host Docusaurus on a CDN.

I've also seen something similar when working on our visual regressions tests (#10650) where I had to skip those 2 problematic URLs:

    '/tests/docs/tests/ascii/%C3%A6%C3%B8%C3%A5',
    '/tests/docs/tests/ascii/folder/%C3%A6%C3%B8%C3%A5',

Most likely this is a bug in our serve-handler dependency. But I'm not sure it's going to be fixed anytime soon 😅

We haven't changed this code much lately, but there was a serve-handler release, maybe it broken something?

https://github.com/vercel/serve-handler/releases/tag/6.1.6

Looks related: vercel/serve-handler#205

@slorber slorber added external This issue is caused by an external dependency and not Docusaurus. and removed status: needs triage This issue has not been triaged by maintainers labels Nov 11, 2024
@fmabap
Copy link
Author

fmabap commented Nov 12, 2024

Thank you!

I installed in the meantime http-server. This seams to work as alternative.

@slorber slorber changed the title Docusaurus crashes if markdown image filename contains non ASCII-Characters docusaurus serve crashes if markdown image filename contains non ASCII-Characters Nov 18, 2024
@slorber slorber changed the title docusaurus serve crashes if markdown image filename contains non ASCII-Characters docusaurus serve crashes if filename contains non ASCII-Characters Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

2 participants