🐛 Bug Report
Following the documentation (specifically https://docusaurus.io/docs/next/markdown-features/code-blocks#syntax-highlighting) I cannot simply add Scala syntax highlight by setting additionalLanguages: ['scala'].
Yes
To Reproduce
Example repository: https://github.com/majk-p/docusaurus-syntax-highlight-issue
Reproduction in sandbox: https://codesandbox.io/s/wandering-cache-lzcj2?file=/docusaurus.config.js (affected resulting website: https://lzcj2.sse.codesandbox.io/docs/intro)
If possible, use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
- Initialize docusaurus
npx @docusaurus/init@2.0.0-beta.0 init website classic
- Add a snippet in a language that's not supported out of the box (as in https://docusaurus.io/docs/next/markdown-features/code-blocks#syntax-highlighting) for example: https://github.com/majk-p/docusaurus-syntax-highlight-issue/blob/master/website/docs/intro.md
- Extend
themeConfig.prism.additionalLanguages with the languages you have used in intro.md, e.g. additionalLanguages: ['scala'],
Please note that I've used Scala as my main sample, but this seems to also affects other languages e.g php
Expected behavior
- The site renders correctly
- The snippets are rendered with correct syntax highlight
Actual Behavior
When visiting the site (in the example the intro page) it renders blank. Additionally there's an issue in dev tools:

Your Environment
-
Public source code: https://github.com/majk-p/docusaurus-syntax-highlight-issue
-
Public site url: not published, please see reproducible demo below
-
Docusaurus version used: 2.0.0-beta.0
-
Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
-
Browsers tested: 88.0.1 and Chromium 90.0.4430.212 (Official Build) snap (64-bit)
-
Node: v12.22.1 locally and (I guess) v14 in sandbox (latest at the time of writing)
-
Operating system and version (desktop or mobile): Ubuntu 20.04
Reproducible Demo
If possible, use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
https://codesandbox.io/s/wandering-cache-lzcj2
Extra notes
Specifically for Scala snippets, using:
additionalLanguages: ['java', 'scala'],
Resolves the issue.
🐛 Bug Report
Following the documentation (specifically https://docusaurus.io/docs/next/markdown-features/code-blocks#syntax-highlighting) I cannot simply add Scala syntax highlight by setting
additionalLanguages: ['scala'].Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Example repository: https://github.com/majk-p/docusaurus-syntax-highlight-issue
Reproduction in sandbox: https://codesandbox.io/s/wandering-cache-lzcj2?file=/docusaurus.config.js (affected resulting website: https://lzcj2.sse.codesandbox.io/docs/intro)
If possible, use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
npx @docusaurus/init@2.0.0-beta.0 init website classicthemeConfig.prism.additionalLanguageswith the languages you have used inintro.md, e.g.additionalLanguages: ['scala'],Please note that I've used Scala as my main sample, but this seems to also affects other languages e.g php
Expected behavior
Actual Behavior
When visiting the site (in the example the
intropage) it renders blank. Additionally there's an issue in dev tools:Your Environment
Public source code: https://github.com/majk-p/docusaurus-syntax-highlight-issue
Public site url: not published, please see reproducible demo below
Docusaurus version used: 2.0.0-beta.0
Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
Browsers tested: 88.0.1 and Chromium 90.0.4430.212 (Official Build) snap (64-bit)
Node: v12.22.1 locally and (I guess) v14 in sandbox (latest at the time of writing)
Operating system and version (desktop or mobile): Ubuntu 20.04
Reproducible Demo
If possible, use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
https://codesandbox.io/s/wandering-cache-lzcj2
Extra notes
Specifically for Scala snippets, using:
additionalLanguages: ['java', 'scala'],Resolves the issue.