Skip to main content

One post tagged with "pnpm"

View All Tags

· One min read
Roger Jiang

Silent bug

This page crashed. "useColorMode()" is used outside of "Layout" component. Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.

Example crash page for a nextjs app

https://www.google.com/search?q=Hook+is+called+outside+the+%3CColorModeProvider%3E%22

Several problems lead to this:

Problem 1: @docusaurus/theme-common missing

was not installed and included in dependencies within package.json

FIX: add to package.json & reinstall deps

Problem 2: @docusaurus depends on React ^17.0.0

FIX: npm i --force-legacy-deps BUT keep using react v18

https://github.com/facebook/docusaurus/issues/6724#issuecomment-1280912963

Working Playground IDE example

caution

Don't use pnpm - it's buggy and the disk space savings aren't worth it!! Painful bugs like this aren't worth it...

TODO: Compare react-live live IDE vs my own @rjnote version later on.

when programming tool fails