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

Custom babelrc file causes errors #35

Closed
andrewgadziksonos opened this issue Nov 18, 2020 · 1 comment
Closed

Custom babelrc file causes errors #35

andrewgadziksonos opened this issue Nov 18, 2020 · 1 comment

Comments

@andrewgadziksonos
Copy link

Hello,

I'm seeing the following error when using a custom babel config,

error - ./pages/_app.tsx
SyntaxError: ./pages/_app.tsx: pragma and pragmaFrag cannot be set when runtime is automatic.
> 1 | import React from "react"
    | ^
  2 | import { NextPage } from "next"
  3 | import { theme, ThemeProvider, GlobalStyles, LazyProvider } from "@sonos-ui/core"
  4 | import dynamic from "next/dynamic"

And here's the custom babel config,

{
  "presets": [
    [
      "next/babel",
      {
        "preset-react": {
          "runtime": "automatic",
          "importSource": "@emotion/core"
        }
      }
    ]
  ],
  "plugins": [["babel-plugin-emotion", { "cssPropOptimization": true }]]
}

I was following along in the emotion instructions (v10) https://5faaafd0bd0f3f0008469537--emotion.netlify.app/docs/css-prop#babel-preset

@andrewgadziksonos
Copy link
Author

Linking this incase anyone gets here system-ui/theme-ui#1160

Changing runtime: classic solved this for me

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

No branches or pull requests

1 participant