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

Created on 23 Mar 2020  路  1Comment  路  Source: emotion-js/emotion

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
bug needs triage

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stolinski picture stolinski  路  37Comments

krzysztofzuraw picture krzysztofzuraw  路  78Comments

jfrolich picture jfrolich  路  29Comments

Enalmada picture Enalmada  路  27Comments

eXtreaL picture eXtreaL  路  29Comments