storybookjs/storybook
[Bug]: Bad error message when trying to use JSX in .js file
Aberta
#21.662 aberto em 17 de mar. de 2023
bugbuilder-vitehelp wanted
Métricas do repositório
- Stars
- (89.909 estrelas)
- Métricas de merge de PR
- (Mesclagem média 7d 22h) (184 fundiu PRs em 30d)
Description
Describe the bug
[storybook:inject-export-order-plugin] Parse error @:22:29
file: ........./src/stories/ApiDocumentation.stories.js
ERR! Error: Parse error @:22:29
ERR! at parse ........./node_modules/es-module-lexer/dist/lexer.cjs:1:402)
ERR! at Object.transform (........./node_modules/@storybook/builder-vite/dist/index.js:1:3217)
ERR! at file:///.........//node_modules/rollup/dist/es/shared/node-entry.js:24343:40
The above error will happen if your .stories.js file contains any JSX. Renaming the file to .jsx fixes the issue. I spent hours trying to figure out the problem. Some better error messaging would be nice here.
To Reproduce
Happens in sandbox project with React and Vite.
System
No response
Additional context
No response