-
Notifications
You must be signed in to change notification settings - Fork 672
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
Syntax error: pragma and pragmaFrag cannot be set when runtime is automatic. #1160
Comments
Nice catch! To support automatic runtime, we'll need to add
https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#react-automatic-runtime As a workaround, you can change your runtime to |
I think the necessary imports are Or a new package could be created, like /** @jsxImportSource @theme-ui/jsx */ |
Correct. Note: keep track of emotion-js/emotion#1970 |
Same problem. |
I'm also experiencing the same issue with |
I believe these issues are because of recent changes to React. I got it working with |
What |
Most recent version, |
I have the same problem. Here is my dependencies:
It is working with |
Waiting for emotion-js/emotion#1970 or alternative work in Emotion. |
- due to this issue - system-ui/theme-ui#1160
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 */
/** @jsx jsx */
import { jsx } from 'theme-ui'; You can also disable the automatic runtime globally instead by setting the environment variable |
same problem, |
@sudarshan070 You need to use classic runtime. Take a look at dcastil's post. |
Seems like Emotion was upgraded in order to support new JSX Runtime : https://github.com/emotion-js/emotion/blob/master/packages/core/CHANGELOG.md |
#1237 will close this. |
I marked that #1237 will close this. However, I'm not sure whether that's the best approach. pragma and pragmaFrag will never work in the automatic JSX runtime, that's intended behaviour. |
I never interpreted the title of this issue as "please make pragmaFrag work in automatic runtime", but I think you're right. |
Confirming it works with dependencies:
|
I 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
[email protected]
, right now the only fix is to go back to[email protected]
and[email protected]
The text was updated successfully, but these errors were encountered: