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.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ThibaudAVcommented, 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

1reaction
shilmancommented, 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
Read more comments on GitHub >

github_iconTop Results From Across the Web

[6.2.7] Cannot create a Story without a component set in export ...
An error is thrown when trying to display a story not having a component set in "export default". To Reproduce import { Meta,...
Read more >
storybook@6 throws a core-js error · Issue #11255 - GitHub
With storybook 6, my very basic typescript setup throws errors about core-js polyfills every time. Module not found: Error: Can't resolve ...
Read more >
Component Story Format (CSF) - Storybook
Every component story file consists of a required default export and one or more named exports. CSF is supported in all frameworks except...
Read more >
storybook cannot read properties of undefined - You.com
The TypeError: Cannot read properties of undefined (reading 'type') exception occurs in storybook when one defines the argTypes in the default export object ......
Read more >
Home does not contain an export named Home - Stack Overflow
The error is telling you that you are importing incorrectly. Here's the code you have to add: import { Home } from './layouts/Home';....
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