Update Storybook 6.2 : TypeError: Cannot convert undefined or null to object
See original GitHub issueDescribe the bug I try migrate my angular application to storybook 6.2 from 6.1. Stories component not display, we have instead a black background with a red border (screenshot below) and we have a javscript error : TypeError: Cannot convert undefined or null to object
Javascript Error
vendors~main.iframe.bundle.js:144634 TypeError: Cannot convert undefined or null to object
at getPrototypeOf (<anonymous>)
at r.parse (vendors~main.iframe.bundle.js:207406)
at Object.t.parse (vendors~main.iframe.bundle.js:207430)
at Mn (vendors~main.iframe.bundle.js:207472)
at Un (vendors~main.iframe.bundle.js:207661)
at Object.parse (vendors~main.iframe.bundle.js:207707)
at Object.parse (vendors~main.iframe.bundle.js:207776)
at ts (vendors~main.iframe.bundle.js:207776)
at us (vendors~main.iframe.bundle.js:207776)
at vendors~main.iframe.bundle.js:207806
Screenshots

Test
Remove storybook from the project, and add a new storybook with : npx sb init
If I create a new angular lib, and init storybook, it’s works, but not with my project.
System
Environment Info:
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
Binaries:
Node: 12.11.1 - C:\PBapps\ctlm-myeclipse\nvm-1.1.7\nodejs\node.EXE
npm: 6.13.6 - C:\PBapps\ctlm-myeclipse\nvm-1.1.7\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.18362.449.0)
npmPackages:
@storybook/addon-actions: ^6.2.8 => 6.2.8
@storybook/addon-essentials: ^6.2.8 => 6.2.8
@storybook/addon-links: ^6.2.8 => 6.2.8
@storybook/angular: ^6.2.8 => 6.2.8
C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:313
throw er
^
Error: ENOTEMPTY: directory not empty, rmdir 'c:\Temp\npm-cache\_npx\20104\node_modules\sb\node_modules\rxjs\src\internal'
at Object.rmdirSync (fs.js:763:3)
at rmkidsSync (C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:356:25)
at rmdirSync (C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:334:7)
at rimrafSync (C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:304:9)
at C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:342:5
at Array.forEach (<anonymous>)
at rmkidsSync (C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:341:26)
at rmdirSync (C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:334:7)
at rimrafSync (C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:304:9)
at C:\PBapps\ctlm-myeclipse\nvm-1.1.7\v12.11.1\node_modules\npm\node_modules\rimraf\rimraf.js:342:5 {
errno: -4051,
syscall: 'rmdir',
code: 'ENOTEMPTY',
path: 'c:\\Temp\\npm-cache\\_npx\\20104\\node_modules\\sb\\node_modules\\rxjs\\src\\internal'
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:23 (4 by maintainers)
Top Results From Across the Web
Yet another Cannot convert undefined or null to object #14752
Describe the bug. A completely white screen shows. When navigating to the Controls tab within add-ons. In the console is the following error...
Read more >TypeError: Cannot convert undefined or null to object in react
This is confusing to me because I have tried getting keys from the output array using Object. keys(books[0]) and it worked, Link to...
Read more >A brand new website interface for an even better experience!
Update Storybook 6.2 : TypeError: Cannot convert undefined or null to object.
Read more >React:Typeerror: Can'T Convert Null To Object - ADocLib
Generic answer This error is caused when you call a function that expects an Object as its argument but pass undefined or null...
Read more >storybook/addon-docs - npm
Storybook Docs transforms your Storybook stories into world-class component documentation. DocsPage. Out of the box, all your stories get a ...
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 Free
Top 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

Is this being worked on by chance? I am running into this when upgrading our storybook to 6.3.4. Hacking the node_modules file /node_modules/@storybook/core-common/dist/cjs/utils/es6Transpiler.js like was suggested above works to fix, but that’s a pretty sucky hack.
I updated
@babel/coreto the latest version as well asbabel-loaderand removed mypackage-lock.jsonas well as removed allnode_modulesReinstalling everything worked for me