(v2) react-loadable-ssr-addon getBundles error
See original GitHub issue🐛 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
React Loadable SSR isn't always giving client complete list of ...
The problem is that react-loadable only sees that it needs the about bundle, not the extra bundle containing moment-timezone.
Read more >react-loadable-s - npm Package Health Analysis - Snyk
Code-splitting is the process of taking one large bundle containing your entire app, and splitting them up into multiple smaller bundles which ...
Read more >Bundle splitting using react-loadable - Toni-Develops
This is happening since Babel doesn't have the appropriate plug-in to transpile dynamic imports. Let's fix this by installing 'plugin-syntax- ...
Read more >An introduction to Webpack Code-Splitting, Loadable ...
So, you have a React application, understand the performance and therefore ... to 'bundles', but each bundle has the extension '.chunk.js'.
Read more >React Loadable:
We've tried and failed a couple of times. What we learned: ❏ You need synchronous module resolution on the server so you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have tried it on the repository where I have found that issue originally (https://github.com/ModDota/moddota.github.io/commit/ddd4b3a2ff3a9ae14603240588ba6c4456f4fc25)
Yes, this patch also makes it work for me