-
Notifications
You must be signed in to change notification settings - Fork 89
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
Typecasting of the default export breaks the parsing of title/args and doesn't load the story #56
Comments
Now I was able to get it not to crash by adding a Nothing in the console. |
Hey @romaia It seems that the type cast for default export The error related to pre-bundling of |
So, I did manage to get one story up and running. Besides the default export, I also had to change one that that used const Template: Story = (args) => {
const [open, setOpen] = React.useState(true);
return (
<Alert {...args} open={open} onClose={() => setOpen(false)}>
{args.children}
</Alert>
);
};
export const WithAction = Template.bind({});
WithAction.args = {
...WithTitle.args,
action: "Ação",
// onActionClick: action("onActionClick"),
};
Uncommenting the
So i guess this is just an incompatibility between ladle and storybook addons. |
Yea. Storybook addons or anything imported from storybook won't work. |
As claimed in the blog post (btw, really excited to try ladle), I tried to use ladle as a drop-in replacement, without success.
First problem is that we use a mono repo with some packages under
<root>/packages
, but ladle assumes stories will be under<root>/src
, so first things first: configure where the stories are. Easily found the documentation, changed that accordingly, but when starting I got an error that no stories were found, still indicating that the default stories glob (src/**/*.stories.{js,jsx,ts,tsx}
).Starting with
DEBUG=ladle*
revealed the real problem:So, there is something wrong with my default exports, it seems. This are the first few lines of that story:
Commenting out the default exports gets me a little bit further. (by now, I am isolating the stories and using just this one, since all our stories have default exports).
I now see a loading spinner with all my stories on the right side menu. Debug logs don't complain about default exports. Some vite messages, but then when it tries to reload, boom.
Important disclaimer: This project does not use vite (yet). We are currently using webpack. It was not clear from the documentation if this would be a problem or not.
The text was updated successfully, but these errors were encountered: