jlvandenhout / docusaurus-plugin-docs-editor

56 stars 13 forks source link

TypeError: Cannot read properties of undefined (reading 'registerLanguage') #41

Open hukarere opened 2 years ago

hukarere commented 2 years ago

Hello, I tried to add the editor plugin to an existing project (managed by npm) using npm install @jlvandenhout/docusaurus-plugin-docs-editor (yarn add would complain that the project is already managed by npm), then added the plugin to docusaurus.config.js.

After that, npm run build, which worked before adding the plugin, fails with:

[ERROR] Docusaurus server-side rendering could not render static page with path /edit.
TypeError: Cannot read properties of undefined (reading 'registerLanguage')
[WARNING] {"moduleIdentifier":"/home/grg/svn/dpanel/docs/docusaurus/devpanel-docs/node_modules/babel-loader/lib/index.js??ruleSet[1].rul
es[5].use[0]!/home/grg/svn/dpanel/docs/docusaurus/devpanel-docs/node_modules/@jlvandenhout/docusaurus-plugin-docs-editor/lib/theme/Edito
r/index.js","moduleName":"./node_modules/@jlvandenhout/docusaurus-plugin-docs-editor/lib/theme/Editor/index.js","loc":"1:2844-2869","mes
sage":"export 'lowlight' (imported as 'lowlight') was not found in 'lowlight/lib/core' (possible exports: highlight, highlightAuto, list
Languages, registerAlias, registerLanguage)","compilerPath":"client"}
[previous line repeated many times]
...
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.

At the same time, npm start (test server) is working, but edit page displays an empty page...

Any hint?

Thanks in advance.

jlvandenhout commented 2 years ago

Thank you for reporting, I'll investigate next week.