Closed gunar closed 3 years ago
I have no idea what might be causing this, my general approach to webpack is to try and pretend it doesn't exist and maybe it will go away... I feel someone who actually understands things better might have to weigh in and help.
does this work with the standard create-react-app preset?
This is because you're using JSX syntax in a .js
file. The default babel config in CRA doesn't transpile .js
files (it transpiles jsx into js). You can see the error is at the exact line you're using jsx syntax: <ThemeProvider .../>
.
You can try renaming preview.js
to preview.jsx
(or preview.tsx
and then fix type errors if you're using TypeScript).
craco.config.js
.storybook/preview.js
Error log