-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution
Description
🐛 Bug Report
Running docusaurus build
in a project with swizzled DocItem and DocPage components throws an when server code is being evaluated.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
- Create a new project using
@docusaurus/init
with classic template - Remove
blog
directory yarn docusaurus swizzle @docusaurus/theme-classic DocItem
yarn docusaurus swizzle @docusaurus/theme-classic DocPage
- Run
yarn build
Expected behavior
docusaurus build
to finish successfully
Actual Behavior
$ docusaurus build
Creating an optimized production build...
[info] [webpackbar] Compiling Client
[info] [webpackbar] Compiling Server
[success] [webpackbar] Client: Compiled successfully in 12.23s
[success] [webpackbar] Server: Compiled with some errors in 13.57s
(undefined) TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
TypeError: Cannot convert undefined or null to object
at main:19364:12
at Array.reduce (<anonymous>)
at getBundles (main:19363:20)
at serverEntry_render (main:35231:113)
(undefined) TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at main:19364:12
at Array.reduce (<anonymous>)
at getBundles (main:19363:20)
at serverEntry_render (main:35231:113)
(undefined) TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at main:19364:12
at Array.reduce (<anonymous>)
at getBundles (main:19363:20)
at serverEntry_render (main:35231:113)
(undefined) TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at main:19364:12
at Array.reduce (<anonymous>)
at getBundles (main:19363:20)
at serverEntry_render (main:35231:113)
(undefined) TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at main:19364:12
at Array.reduce (<anonymous>)
at getBundles (main:19363:20)
at serverEntry_render (main:35231:113)
Error: Failed to compile with errors.
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/@docusaurus/core/lib/commands/build.js:38:24
at finalCallback (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/MultiCompiler.js:254:12)
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/MultiCompiler.js:277:6
at done (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/neo-async/async.js:2931:13)
at runCompilers (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/MultiCompiler.js:181:48)
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/MultiCompiler.js:188:7
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/MultiCompiler.js:270:7
at finalCallback (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/Compiler.js:257:39)
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/Compiler.js:273:13
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/Compiler.js:271:21)
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/Compiler.js:681:15
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/tapable/lib/Hook.js:154:20)
at /home/runner/work/docusaurus-issue/docusaurus-issue/node_modules/webpack/lib/Compiler.js:678:31
at Function.keys (<anonymous>)
at Array.reduce (<anonymous>)TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Array.reduce (<anonymous>)TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Array.reduce (<anonymous>)TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Array.reduce (<anonymous>)TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Array.reduce (<anonymous>)
Your Environment
- Docusaurus version used: 2.0.0-alpha.56
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node.js v14.3.0
- Operating system and version (desktop or mobile): Linux
Reproducible Demo
https://github.com/ark120202/docusaurus-issue
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution