React: `_jsx is not defined` error

See original GitHub issue

_Originally posted by @nandosangenetto in https://github.com/storybookjs/storybook/issues/12881#issuecomment-718969472_

I’m getting the same error that @DiFuks is getting, _jsx is not defined.

image

I’ve created a small repo where you can reproduce this bug: https://github.com/nandosangenetto/storybook-bug-repro

I’ve tried to remove all addons, as @DiFuks did, but it didn’t work.

What is odd is that it works when I run npm run storybook (start-storybook -p 6006), but fails when I try to build it with npm run build-storybook (build-storybook).

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:32 (11 by maintainers)

github_iconTop GitHub Comments

22reactions
Yagocommented, Dec 8, 2020

Adding this minimal /.storybook/.babelrc worked for me (using next.js):

// .babelrc
{
  "presets": ["next/babel"]
}

Same solution for me, but with a less duplicated configuration:

// ./.storybook/.babelrc

{
  "extends": "../.babelrc"
}

8reactions
DiFukscommented, Nov 12, 2020

@sibelius Unfortunately, the problem has not been resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'JSX' is not defined - reactjs - Stack Overflow
Try define your component as FunctionComponent from react . It has own children property: import React, {FunctionComponent } from 'react'; ...
Read more >
Introducing JSX - React
It is called JSX, and it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI...
Read more >
Line 12:6: 'Fragment' is not defined react/jsx-no-undef Code ...
'App' is not defined react/jsx-no-undef Search for the keywords to learn more about each error. ... ./src/views/User/JobDetail.js Line 1068:117: ' ...
Read more >
React not defined | React import error - YouTube
Watch ads now so you can enjoy fewer interruptions. Got it. JS - JavaScript. React not defined | React import error. 754 views...
Read more >
'Remarkable' is not defined no-undef.} SOLVED in React
ERROR : 'Remarkable' is not defined no-undef. , solved in React.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found