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

[Bug]: Code highlight does not work in build output #364

Closed
Tracked by #419
m-radmacher opened this issue Nov 15, 2023 · 4 comments
Closed
Tracked by #419

[Bug]: Code highlight does not work in build output #364

m-radmacher opened this issue Nov 15, 2023 · 4 comments
Labels
🐞 bug Something isn't working need reproduction

Comments

@m-radmacher
Copy link

Version

System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
    Memory: 1.90 GB / 15.53 GB
  Browsers:
    Edge: Chromium (119.0.2151.58)
    Internet Explorer: 11.0.22621.1

I think it didn't correctly identify the package because I'm using pnpm in a monorepo. Here are the dependencies of the docs:

  "dependencies": {
    "lucide-react": "^0.292.0",
    "rspress": "^1.4.0"
  },
  "devDependencies": {
    "@types/node": "^20.9.0"
  }

Details

After building my docs in a Docker container and deploying that container I noticed that the code blocks were all missing their syntax highlighting. I tested it again locally using dev and the highlighting was back.

It seems that the build step does not add the syntax highlighting to the output.

Reproduce link

https://codesandbox.io/p/sandbox/fervent-shamir-vf5v3s?file=%2Fdocs%2Findex.md&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clozomo9300082a68q2vqmtne%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clozomo9300032a68yo5g4cwo%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clozomo9300052a680arzqdvr%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clozomo9300072a686d7fzp7s%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clozomo9300032a68yo5g4cwo%2522%253A%257B%2522id%2522%253A%2522clozomo9300032a68yo5g4cwo%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clozomo9300072a686d7fzp7s%2522%253A%257B%2522id%2522%253A%2522clozomo9300072a686d7fzp7s%2522%252C%2522activeTabId%2522%253A%2522clozor6iz01gn2a68ixy8cnuv%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clozomo9300062a686adwlj2c%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A8080%252C%2522path%2522%253A%2522%252F%2522%257D%252C%257B%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522preview%2522%252C%2522port%2522%253A4173%252C%2522id%2522%253A%2522clozor6iz01gn2a68ixy8cnuv%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%257D%252C%2522clozomo9300052a680arzqdvr%2522%253A%257B%2522id%2522%253A%2522clozomo9300052a680arzqdvr%2522%252C%2522activeTabId%2522%253A%2522clozor2v901ej2a68mykk0vlg%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clozomo9300042a68cdtf9iml%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522build%2522%252C%2522id%2522%253A%2522clozoor4f00tp2a68z85e71f0%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522preview%2522%252C%2522id%2522%253A%2522clozor2v901ej2a68mykk0vlg%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%255D%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Reproduce Steps

  1. run the project using dev
  2. check the index page -> the code block should have highlighting
  3. run the build script
  4. run the preview script
  5. check the index page again -> the code block no longer has highlighting
@m-radmacher m-radmacher added the 🐞 bug Something isn't working label Nov 15, 2023
@sanyuan0704
Copy link
Collaborator

The highlight in production preview works in my codesandbox:
image

@m-radmacher
Copy link
Author

Did you change anything? It's not showing up for me. Pretty sure this isn't the problem, but what browser are you using? I'm running Firefox 120.0.

grafik

@shenjackyuanjie
Copy link

@m-radmacher check out #419

@Timeless0911
Copy link
Collaborator

I think this issue has been completed, reopen it if still have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working need reproduction
Projects
None yet
Development

No branches or pull requests

4 participants