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

v6.4.0-alpha.0 swallows errors #15357

Open
gajus opened this issue Jun 25, 2021 · 1 comment
Open

v6.4.0-alpha.0 swallows errors #15357

gajus opened this issue Jun 25, 2021 · 1 comment

Comments

@gajus
Copy link

gajus commented Jun 25, 2021

Describe the bug

storybook quietly fails without surfacing errors in .stories.tsx files.

To Reproduce

import {
  storiesOf,
} from '@storybook/react';
import React from 'react';
import * as templates from '../templates';

for (const [name, template] of Object.entries(templates)) {
  // `storiesOf` is currently the only way (even though marked as "legacy") to generate dynamic stories.
  // It is the only way currently possible and they are not planning to remove it until there is a replacement.
  // https://github.com/storybookjs/storybook/issues/9828#issuecomment-781387767
  const subject = storiesOf('Templates/' + name);

  throw new Error('OK');
}

Additional context

I would expect to see some reference to error "OK".

However, build just completes without any errors:

info => Using cached manager
webpack built preview 56918557f0342b18a688 in 7818ms
╭───────────────────────────────────────────────────╮
│                                                   │
│   Storybook 6.4.0-alpha.0 started                 │
│   8.05 s for preview                              │
│                                                   │
│    Local:            http://localhost:6006/       │
│    On your network:  http://192.168.4.40:6006/    │
│                                                   │
╰───────────────────────────────────────────────────╯


@SebastianStehle
Copy link

I have the same issue with 6.4.9

e.g. when I have the following file

// test.js
export const foo = 1;
throw new Error('123');

and import that, the error is just swallowed.

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

4 participants