Skip to content

(v2) react-loadable-ssr-addon getBundles error #2898

@ark120202

Description

@ark120202

🐛 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

  1. Create a new project using @docusaurus/init with classic template
  2. Remove blog directory
  3. yarn docusaurus swizzle @docusaurus/theme-classic DocItem
  4. yarn docusaurus swizzle @docusaurus/theme-classic DocPage
  5. Run yarn build

Expected behavior

docusaurus build to finish successfully

Actual Behavior

Failed CI logs

$ 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 execution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions