Comments (9)
I've found the issue here and will push it shortly.
from presets.
@n8sabes, this was caused by the CRA preset applying the wrong loader to files imported by Storybook.
The correction is here:
https://github.com/storybookjs/presets/pull/77/files#diff-80b3f28ef184f3c7a4ac83b1974c3dc6R147
from presets.
@ljharb you're right - but this was never meant to be transpiled. The loader was simply omitted from the original preset, the new preset was forked from that, and the bug was carried over.
This is the related code:
https://github.com/SeedJobs/react-scripts/blob/master/packages/react-scripts/config/webpack.config.js#L489
from presets.
What I did:
cra | sb | result |
---|---|---|
3.3.0 | [email protected] | O |
3.3.0 | [email protected] + [email protected] | X |
3.3.0 | [email protected] (auto-installs preset-cra) | X |
3.3.0 | [email protected] - [email protected] | O |
3.3.0 | [email protected] + [email protected] | X |
In other words, the problem appears to be an incompatibility between @storybook/preset-create-react-app
and something else in the ecosystem (latest version of CRA? some change in inspect-js
(see also: inspect-js/is-map#3)?
Other comments suggest that babel-loader
is being applied to node_modules
(see inspect-js/is-map#3 (comment))
from presets.
It seems that this rule tries to transpile is-map and fails?
from presets.
Fixed in @storybook/[email protected]
!! Please upgrade and try it out! Thanks @mrmckeb for the fix 🙌
from presets.
Upgrading takes care of it, thank you so much for the quick turn around everyone!
from presets.
@mrmckeb and @shilman -- What was the cause and solution of this issue? I am running into the same problem with another (more mature) CRA project. Downgrading deep-equal to 1.1.1
works around the problem but unsure of the true origin or "correct" fix. Any insight is appreciated.
Please see:
deep-equal issue #78
from presets.
Top-level return is perfectly valid inside node modules; transpiling code you didn't author is unsafe; if you're going to transpile node_modules, then you should be sure to use settings that work on valid node modules :-)
from presets.
Related Issues (20)
- [Bug] CRA does not print eslint errors to terminal anylonger
- [Bug] CRA preset does not support ES2020 dependencies HOT 2
- Where are the tests for your presets?
- V3.2.0 works but V4.0.0 does not HOT 4
- [Bug] preset-create-react-app: Storybook config dir webpack override breaks default CRA config
- [Bug] Install @storybook/preset-scss with default storybook's bundler 'webpack4' doesn't works HOT 5
- [Bug] CRA5, [email protected] HOT 6
- [Bug] Fails in case of using custom folder structure inside /src
- [Help] Cannot find module '@babel/plugin-proposal-private-property-in-object'
- @storybook/preset-create-react-app 4.0.1 breaks Storybook HOT 4
- [Bug]: macos - Error: Cannot find module '.../node_modules/config/webpack.config' HOT 5
- [Bug] URL from readme does not exist on the website
- [Bug] ENAMETOOLONG on "preset-create-react-app@4" package installation HOT 1
- [Bug] start-storybook breaks when tsconfig.json has comments (preset-create-react-app)
- [Bug] Package dependency HOT 4
- [Bug] Confusing error message when stories folder is outside of src.
- [Bug] cannot run storybook with CRA preset version 4.1.0. HOT 1
- @storybook/react-docgen-typescript-plugin canary dependency
- [Bug] Storybook preset function `getReactScriptsPath` has bug HOT 2
- Missing license file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presets.