Skip to content

Fix prism-react-renderer v2 theme import breaking Docusaurus build#3

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-deploy-to-github-pages
Draft

Fix prism-react-renderer v2 theme import breaking Docusaurus build#3
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-deploy-to-github-pages

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown

docusaurus.config.js used the prism-react-renderer v1 subpath API while package.json pins v2.4.1, which dropped those subpath exports — causing a MODULE_NOT_FOUND error that prevented the config from loading at all.

Changes

  • docusaurus.config.js: Replace deprecated v1 subpath imports with the v2 themes named export:
// Before (v1 API — no longer valid in v2)
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme  = require('prism-react-renderer/themes/dracula');

// After (v2 API)
const {themes: prismThemes} = require('prism-react-renderer');
const lightCodeTheme = prismThemes.github;
const darkCodeTheme  = prismThemes.dracula;

@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for scifracx failed.

Name Link
🔨 Latest commit f1d8c27
🔍 Latest deploy log https://app.netlify.com/projects/scifracx/deploys/6a2917348f528200082112c9

Copilot AI changed the title [WIP] Fix failing GitHub Actions job Deploy to GitHub Pages Fix prism-react-renderer v2 theme import breaking Docusaurus build Jun 10, 2026
Copilot AI requested a review from ErikQQY June 10, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants