-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
"Error: Webpack Compilation Error" with "pragma and pragmaFrag cannot be set when runtime is automatic" false-positive comment #20952
Comments
I tried changing the comments from
|
It looks like my assumption about the interpretation of the top-level file comment was wrong, as removing the comments still leads to the same issue.
I'm not sure what the error is at this point, I don't know why it only affects Cypress and not the whole Next.js build either. |
This was a Babel/Webpack/TS configuration issue introduced by changing the babel config required by Emotion 11. It has been explained and fixed at UnlyEd/next-right-now#247 |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
12
What browser are you using?
Chrome
What operating system are you using?
MacOS
How are you deploying your application?
Vercel
Describe the Bug
Running Cypress fails with
pragma and pragmaFrag cannot be set when runtime is automatic.
.It's related to a recent change in
babel.config.js
, which now usespreset-react
withautomatic
mode. (added to support Emotion 11)I'm not sure if it's an issue in Next.js or Cypress itself. It's definitely because I changed the Next.js babel configuration, but the underlying issue might be on Cypress's side.
Expected Behavior
It should compile, the
// ***********************************************************
is not a pragma, it's detected as a false-positive pragma.To Reproduce
PR: UnlyEd/next-right-now#243
Use following
babel.config.js
:And keep the default Cypress comments, e.g:
The text was updated successfully, but these errors were encountered: