Syntax error: pragma and pragmaFrag cannot be set when runtime is automatic.
See original GitHub issueI started having this error since updating Gatsby to the most recent version and updating React to v17.
Syntax error: pragma and pragmaFrag cannot be set when runtime is automatic.
edit: The same issue now exists with the latest version of React react@16.14.0
, right now the only fix is to go back to react@16.13.1
and react-dom@16.13.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Emotion CSS Prop and Nextjs new JSX runtime - error
Emotion CSS Prop and Nextjs new JSX runtime - error: pragma and pragmaFrag cannot be set when runtime is automatic.
Read more >How to solve Pragma and pragmafrag can not be set while ...
How to solve Pragma and pragmafrag can not be set while runtime is automatic error ... What is a pragma? A pragma is...
Read more >Error pragma and pragmaFrag cannot be set when runtime is ...
Hi team, @alexaspalato :wave: When i try to run npx frontity dev i get this error ` Error: .
Read more >Error: x pragma cannot be set when runtime is automatic
If you are using Theme UI and you upgraded a react app or next.js app and you encounter an Error : pragma cannot...
Read more >Pragma and pragmaFrag cannot be set when runtime is ...
How to solve pragma and pragmaFrag cannot be set when runtime is automatic when using theme ui in react.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just adding here in case anyone sees this error message after upgrading a project to create-react-app v4:
Theme UI currently only supports the classic JSX runtime. Until emotion is upgraded to support the automatic runtime and Theme UI can be upgraded, add the comment
/** @jsxRuntime classic */
to all files using thesx
prop. This should fix the issue.You can also disable the automatic runtime globally instead by setting the environment variable
DISABLE_NEW_JSX_TRANSFORM=true
, e.g. in your.env
file.Confirming it works with dependencies: