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

The mdx-code-block is not compatible with Windows. #9988

Closed
2 of 7 tasks
wyy0512 opened this issue Mar 27, 2024 · 3 comments
Closed
2 of 7 tasks

The mdx-code-block is not compatible with Windows. #9988

wyy0512 opened this issue Mar 27, 2024 · 3 comments
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@wyy0512
Copy link

wyy0512 commented Mar 27, 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

Placing JSX in mdx-code-block works fine on Linux, but when developing on Windows, it directly displays the code block instead.

Reproducible demo

No response

Steps to reproduce

Placing a piece of JSX inside mdx-code-block and running it in a Windows environment can reproduce the issue.

Expected behavior

The card list has been rendered.
image

Actual behavior

The code block is presented.
image

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used: 3.1.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):chrome, Node.js 20.9.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10

Self-service

  • I'd be willing to fix this bug myself.
@wyy0512 wyy0512 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 Mar 27, 2024
@OzakIOne
Copy link
Collaborator

OzakIOne commented Mar 27, 2024

image
image

I've tested on windows without WSL and in WSL, same result

Stackblitz

I don't know why stackblitz doesn't interpret the one with the mdx-code-block label though

image

@OzakIOne OzakIOne added closed: can't repro This bug is because of some local setup that can't be reproduced. and removed 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 Mar 27, 2024
@Josh-Cena
Copy link
Collaborator

@OzakIOne I think it's because of \r\n. Have you turned on CRLF?

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Mar 27, 2024

That said, it should be fixed by #9897. I don't know if it's part of 3.1.1 though!

Edit: looks like no. So when the next version gets released, it will be fixed. In the meantime, please configure your editor to use LF instead of CRLF.

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed closed: can't repro This bug is because of some local setup that can't be reproduced. labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants