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

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

Closed
kentcdodds opened this issue Mar 23, 2020 · 1 comment
Closed

Comments

@kentcdodds
Copy link
Contributor

Current behavior:

If you set the /** @jsx jsx */ as instructed in the docs, and then try to use a React Fragment, you get the following error:

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

To reproduce:

  1. npm create react-app pragma-issue
  2. npm install @emotion/core
  3. add /** @jsx jsx */ and then import {jsx} from '@emotion/core' to src/index.js
  4. npm run build

You'll get the error.

Add /** @jsxFrag React.Fragment */ to the top of the file and the error goes away.

Expected behavior:

This is a new error. Maybe it's something that babel can fix so we don't have to add /** @jsxFrag React.Fragment */ to every file...

Environment information:

  • react version: latest
  • emotion version: latest
@kentcdodds
Copy link
Contributor Author

Just checked and babel's restoring the original behavior: https://twitter.com/existentialism/status/1242180403928195075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@kentcdodds and others