question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update Storybook 6.2 : TypeError: Cannot convert undefined or null to object

See original GitHub issue

Describe 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 image

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:open
  • Created 2 years ago
  • Reactions:4
  • Comments:23 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
rickhopkinscommented, Jul 16, 2021

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.

5reactions
kroedercommented, Apr 28, 2021

I updated @babel/core to the latest version as well as babel-loader and removed my package-lock.json as well as removed all node_modules

Reinstalling everything worked for me

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found