Skip to content

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

Closed

Description

@karlhorky

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

Activity

  1. ianschmitz commented on May 14, 2020

    @ianschmitz
    Contributor

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

  2. karlhorky commented on May 15, 2020

    @karlhorky
    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?

  3. locked and limited conversation to collaborators on May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions