Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel-preset-react-app: Upgrade @babel/preset-react to 7.9.4 to restore pragmaFrag default #8999

Closed
karlhorky opened this issue May 13, 2020 · 2 comments

Comments

@karlhorky
Copy link

Describe the bug

With the current version of babel-preset-react-app, @babel/preset-react is pinned to 7.9.1, which causes errors like this one from Emotion:

emotion-js/emotion#1820

transform-react-jsx: pragma has been set but pragmaFrag has not been set

This has been fixed in @babel/preset-react@7.9.4:

babel/babel#11324 (comment)

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

  • pragmaFrag
  • babel
  • preset
  • react

Found #8709, which is inexplicably closed.

Environment

Environment Info:

  current version of create-react-app: 3.4.1
  running from /Users/k/.npm/_npx/28361/lib/node_modules/create-react-app

  System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
  Binaries:
    Node: 13.12.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 81.0.4044.138
    Firefox: 75.0
    Safari: 13.1
  npmPackages:
    react: ^16.13.1 => 16.13.1
    react-dom: ^16.13.1 => 16.13.1
    react-scripts: 3.4.1 => 3.4.1
  npmGlobalPackages:
    create-react-app: 1.3.3

Steps to reproduce

  1. Install Emotion and use as described on the homepage
  2. See the error with pragmaFrag

Expected behavior

No error with pragmaFrag

Actual behavior

Error with pragmaFrag

Reproducible demo

https://github.com/upleveled/react-components-props-state-may-2020

Remove this line:
https://github.com/upleveled/react-components-props-state-may-2020/blob/6a0710a88489481ad84dbda4e382ad6ab0e61a07/src/Counter.js#L2

@ianschmitz
Copy link
Contributor

We've already updated to 7.9.4 on master. It will be in our 4.0 release.

@karlhorky
Copy link
Author

@ianschmitz thanks, I guess this was in #8947, sorry for the issue noise!

Would it be possible to backport just this fix to a 3.x branch, for those who can't bump to the next semver major?

@lock lock bot locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants