Skip to content
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

[6.2.7] Cannot create a Story without a component set in export default #14575

Closed
kanidjar opened this issue Apr 13, 2021 · 8 comments
Closed

Comments

@kanidjar
Copy link

kanidjar commented Apr 13, 2021

Describe the bug

An error is thrown when trying to display a story not having a component set in "export default".

To Reproduce

import { Meta, Story } from '@storybook/angular';

export default {
    title: 'HTML Elements/Buttons'
} as Meta;

export const Base: Story = args => ({
    props: args,
    template: '<button>{{content}}</button>'
});

Base.args = {
    content: 'Primary button'
};

Expected behavior

The HTML element "button" should appear on the page without any error.

System

  System:
    OS: macOS 11.0.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 14.15.1 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.114
    Safari: 14.0.1
  npmPackages:
    @storybook/addon-essentials: ^6.2.1 => 6.2.7 
    @storybook/angular: ^6.2.1 => 6.2.7 

Workaround

Pass any component in "export default"

┆Issue is synchronized with this Asana task by Unito

@shilman
Copy link
Member

shilman commented Apr 13, 2021

@ThibaudAV is this required now? I think we are supporting the old format until 7.0?

https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-angular-story-component

@ThibaudAV
Copy link
Contributor

normally not 🤔 yes that's what the code should do, I'll go look

@ThibaudAV
Copy link
Contributor

🤔 I just tested with 6.2.7. and the example code I have no error :sad:

@kanidjar can you give a repo with the error reproduction?

@kanidjar
Copy link
Author

sure @ThibaudAV , you will get it by the end of the day

@kanidjar
Copy link
Author

@ThibaudAV : https://github.com/kanidjar/storybook

You will find the example story in apps/extranet/src/app

nx run extranet:storybook

@ThibaudAV
Copy link
Contributor

ThibaudAV commented Apr 13, 2021

Perfect it reproduces well the problem

Well it seems to be linked to ngcc if not executed it works perfectly ^^
Storybook does not use ivy yet but should be compatible with a workspace using it

It will be necessary to add this change earlier than expected
https://github.com/storybookjs/storybook/pull/11157/files#diff-70601b7629ca05a548de90f4bd456a56cbd6494c5bb3028f0942267ba1a8167fR45

@shilman I'll propose a PR

@shilman
Copy link
Member

shilman commented Apr 14, 2021

Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.0-alpha.7 containing PR #14586 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Apr 14, 2021
@shilman
Copy link
Member

shilman commented Apr 23, 2021

Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.9 containing PR #14586 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants