When i try to run npx frontity dev i get this error
`
Error: ./packages/frontity-starter-theme/src/components/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/dejangeorgiev/Code/frontity-theme-ui-tailwindcss/packages/frontity-starter-theme/src/components/index.js: pragma and pragmaFrag cannot be set when runtime is automatic.
1 | /** @jsx jsx */
| ^
2 | import { jsx, Flex, ThemeProvider } from “theme-ui”;
3 | import theme from “…/theme-ui”;
4 | import { Global, connect, Head } from “frontity”;`
I did some research but didn’t found anything that might fix this issue. Can someone please assist me on this?
I just re-edited this as the issue seems to be related to React 17, but I could be wrong! I think it has to do with the new JSX transform? Either way, I tried a couple of themes and they both had the same issue.
Indeed with the last frontity versions we’ve updated the versions to React 17 and Emotion 11. With these changes, the jsx runtime now handles the transformations for jsx to createElement calls. With that, emotion needs to handle the jsx runtime as well so we had to let emotion’s babel plugin take over the jsx runtime.
Thank you very much for providing this information. This works, however the theme is designed with styled-components and not with Emotion. I suggest if you got a 15min. time to play around to do the following in order to reproduce the issue.
Clone the repo
Update the dependencies
Run the dev server
Then you will see the same issue as i described above. You can try to install @emotions/core , @emotions/react and @emotions/styled this will fix the issue with Pragma, but will broke the style structure.
I know there are no issues with Frontity packages and this is a third-party theme, but let me know if you have any insights on that.