You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a next.js project. When I start it and try to load anything, I get:
yarn dev
yarn run v1.22.19
$ next dev
- ready started server on 0.0.0.0:3000, url: http://localhost:3000
- info automatically enabled Fast Refresh for 1 custom loader
- event compiled client and server successfully in 120 ms (21 modules)
- wait compiling...
- event compiled client and server successfully in 80 ms (21 modules)
- wait compiling / (client and server)...
- error ./styles/GlobalStyles.js
Error:
x the name `_GlobalStyles` is defined multiple times
,-[/Users/aaron/demo/styles/GlobalStyles.js:1:1]
1 | import { css as _css } from "@emotion/react";
2 | import { Global as _globalImport } from "@emotion/react";
3 | const _GlobalStyles = () => <_globalImport styles={_css`*, ::before, ::after {
: ^^^^^^|^^^^^^
: `-- previous definition of `_GlobalStyles` here
4 | box-sizing: border-box;
5 | border-width: 0;
As far as I can tell I am only importing GlobalStyles once so I'm unsure why it's getting built twice.
I read through #277 and tried some of the suggestions there but it didn't resolve the issue. I'm not sure if this is a bug or user error, so apologies in advance if I did something simple wrong 🥲
The text was updated successfully, but these errors were encountered:
I spent a little while troubleshooting but wasn't too sure of the cause.
I do see there's a funky looking twin config in babel-plugin-macros.config.js (not the cause of this issue though).
Take a look at the official next-emotion example for a working configuration using the src folder - sorry I couldn't help out more here.
I have a next.js project. When I start it and try to load anything, I get:
As far as I can tell I am only importing
GlobalStyles
once so I'm unsure why it's getting built twice.My
package.json
dependencies are:and
devDependencies
:I've posted a reproducible demo here - just clone,
yarn install
, andyarn dev
: https://github.com/getaaron/demoI read through #277 and tried some of the suggestions there but it didn't resolve the issue. I'm not sure if this is a bug or user error, so apologies in advance if I did something simple wrong 🥲
The text was updated successfully, but these errors were encountered: