question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

missing @babel/plugin-transform-react-jsx-self after run eject

See original GitHub issue

Is this a bug report?

bug

Did you try recovering your dependencies?

i run yarn add @babel/plugin-transform-react-jsx-self -D and fixed it

Environment

version 2.1.8

Steps to Reproduce

(Write your steps here:)

  1. create-react-app test-rc --typescript
  2. yarn eject
  3. yarn start

Expected Behavior

no error

Actual Behavior

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
abel1105commented, Apr 4, 2019

Running to the same problem here. After struggling with the whole afternoon, I came out with something that may be useful?

  1. It seems to only happen on Yarn, not with NPM.
    • npx create-react-app my-app --use-npm works great after eject.
  2. After npm pack and test it with the react-script.tgz file, everything works great on my local create-react-app env.
  3. I try to figure out what happens inside node_modules, so I follow #6099 instruction about delete whole node_module and reinstall with yarn again. The image below is the compare directory result between the reinstall one(left) and the broken one(right), and the only different is inside the node_modules > babel-preset-react-app > node_modules > @babel.
螢幕快照 2019-04-04 下午1 59 33 螢幕快照 2019-04-04 下午3 50 16

It seems like after running npx create-react-app my-app, the node_modules has babel-preset-react-app inside, and when running yarn eject, although react-script removed from package.json and babel-preset-react-app replaced it, Yarn didn’t resolve babel-preset-react-app again.

I try to fix the broken one with yarn remove babel-preset-react-app and yarn add babel-preset-react-app and it works. Maybe can add some script to clean up the babel-preset-react-app before or after yarn install, and it will be fixed.

https://github.com/facebook/create-react-app/blob/e630238d0d5870aa0f20e487b12708935cf58737/packages/react-scripts/scripts/eject.js#L309-L312

0reactions
heyimalexcommented, Apr 18, 2019

Closing in favor of #6099

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module '@babel/plugin-transform-react-jsx-source'
Add a file called babel.config.js to the root of your repository. Put this in the babel.config.js file ... After you execute npm run...
Read more >
babel/plugin-transform-react-jsx-self
NOTE**: This plugin is included in `@babel/preset-react` ... npm install --save-dev @babel/plugin-transform-react-jsx-self.
Read more >
Inside create-react-app - DataDrivenInvestor
To run your React application, you need to turn your JSX into plain JavaScript, that browser can understand. We need transpilers and bundlers...
Read more >
Solving Babel issue in Ejected React Application - Medium
After ejecting from the React application, when you try to run the application locally you will get a JavaScript error saying that it...
Read more >
@babel/plugin-transform-react-jsx | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
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