-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Storybook 6.2 : TypeError: Cannot convert undefined or null to object #14631
Comments
Did you try removing |
Yes, I remove all many time and reinstalling. |
Try running with |
Same here. In my case, removing both @addon-docs and @whitespace/storybook-addon-html helped. |
Per #14262, removing But that's not an acceptable workaround for me. |
As @certainlyakey wrote - removing |
Ok to me, it meant removing |
I resolve the issus, but I not know how. Now, I have this error : It's display the component one time, and the second view there are an error. |
For me it's acceptable, at least until an official fix is out. I've managed to resolve the issue with both |
I solved this following these steps:
Removing the |prettifier from the regex in node_modules worked too, but I didn't want to go through writing a fix in main.js. However now I have a different error for stories using ngmodel, like #14643 |
I went with the workaround with patch-package suggested by @certainlyakey ! |
I solved it by disabling the docs addon with still benefiting from
Of cause this only helps if you are not using the docs addon anyways. |
Upgrading to Storybook v6.2.9 fixed this issue for me, since it pulls in a recent enough version of Babel where the underlying bug is fixed. |
yes its a pb with Babel i think already fixed here |
2.6.9 fixed noting for me. addons-docs still pulls @babel/core 7.12.10 |
I updated Reinstalling everything worked for me |
The same issue, #14631 (comment) works for me. |
I'm facing the same issue after upgrading storybook. #14631 (comment) solved for me but it is not something I can adopt in my project, can't tell every developer to install and then directly changes the Tried #14631 (comment) approach but unfortunately it did not work for me. Also tried to use prerelease mentioned on #14752 (comment) and it didn't work. Looking forward to a bugfix of this issue so I can safely upgrade it to the new version. |
@kyro38 what was the patch-package command you ran to patch this change? |
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. |
FWIW, simply upgrading
So this wasn't really a problem in Storybook, but simply poorly managed dependencies. |
Here's a minimal config that gets me this error. Removing (For convenience, I've created a repository. Feel free to check it out.)
{
"scripts": {
"storybook": "start-storybook -p 9001 -c .storybook"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"@storybook/addon-interactions": "^6.3.12",
"@storybook/react": "6.3.12",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"react-scripts": "^4.0.3",
"typescript": "4.6.3"
}
}
module.exports = {
stories: ["../src/*.stories.tsx"],
addons: ["@storybook/addon-interactions"],
}; And a couple of test files:
import * as React from "react";
export const Component: React.FC = () => {
return <span>I am a test</span>;
};
import * as React from "react";
import { Component } from "./Test";
export default {
title: "test",
component: Component,
};
export const Test = () => <Component />; The precise error message is this:
Updating |
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
|
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
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
The text was updated successfully, but these errors were encountered: