https://github.com/ph-fritsche/repro-storybook-es2020
https://github.com/ph-fritsche/repro-storybook-es2020
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ph-fritsche/repro-storybook-es2020
- Owner: ph-fritsche
- Created: 2021-09-06T10:18:52.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-06T10:24:09.000Z (almost 4 years ago)
- Last Synced: 2025-02-28T16:36:25.198Z (4 months ago)
- Language: HTML
- Size: 254 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**Reproduction of storybook defaults being incompatible with ES2020 dependencies**
# What do I see here?
1. A dependency in ES2020 syntax: [*/dependency-foo*](https://github.com/ph-fritsche/repro-storybook-es2020/tree/master/dependency-foo)
2. A component using this dependency: [*/src/App.tsx*](https://github.com/ph-fritsche/repro-storybook-es2020/blob/master/src/App.tsx)
3. A minimal CRA setup
3. The storybook config created per `npx sb init`
# What to do?
1. Open the repro in the [devcontainer](https://github.com/ph-fritsche/repro-storybook-es2020/blob/master/.devcontainer.json) or on your local machine.
2. Install dependencies per `yarn install`.
3. 1. Start the `react-scripts` development server: `yarn start`
*=> Works*2. Start storybook: `yarn storybook`
*=> Fails due to `ModuleParseError: Module parse failed: Unexpected token`.*
```
| export default function foo(s) {
> return s?.optional ?? 'foo'
| }
|
```