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

Storybook fails to load a custom class extending Date #14618

Closed
Mintoo200 opened this issue Apr 15, 2021 · 2 comments
Closed

Storybook fails to load a custom class extending Date #14618

Mintoo200 opened this issue Apr 15, 2021 · 2 comments
Labels
cra Prioritize create-react-app compatibility question / support

Comments

@Mintoo200
Copy link

Mintoo200 commented Apr 15, 2021

Describe the bug
I added a custom class extending Date to my project adding some helper functions but storybook considers every occurence where I use it as a simple Date and throws a <helper function> is not a function. This problem does not occur when I start the CRA app with the Calendar directly.

To Reproduce

  1. clone this repository on Github
  2. start the storybook with $ yarn; yarn storybook
  3. navigate to localhost:6006
  4. go to Calendar>Default

You can start the working CRA app with $ yarn start

Expected behavior
The calendar should be displayed with no error.

System

Environment Info:

  System:
    OS: macOS 11.2.3
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
  Binaries:
    Node: 12.18.3 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.6 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.128
    Safari: 14.0.3
  npmPackages:
    @storybook/addon-actions: ^6.2.8 => 6.2.8 
    @storybook/addon-essentials: ^6.2.8 => 6.2.8 
    @storybook/addon-links: ^6.2.8 => 6.2.8 
    @storybook/node-logger: ^6.2.8 => 6.2.8 
    @storybook/preset-create-react-app: ^3.1.7 => 3.1.7 
    @storybook/react: ^6.2.8 => 6.2.8 

Additional context

The problem still occurs when the storybook is built and served with npx serve. I also tried reinstalling all dependencies.
Also casting the Date to a CustomDate as I call the helper function (with (new CustomDate(myDate)).helperFunction() or (myDate as CustomDate).helperFunction()) still cause the error to trigger.

@shilman shilman added cra Prioritize create-react-app compatibility question / support labels Apr 16, 2021
@Mintoo200
Copy link
Author

Hey, any update on this?

@shilman
Copy link
Member

shilman commented Jun 8, 2023

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:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cra Prioritize create-react-app compatibility question / support
Projects
None yet
Development

No branches or pull requests

2 participants