with-emotion throws an error during `yarn build`
See original GitHub issueBug report
Describe the bug
with-emotion
example throws an error during the build.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- git clone https://github.com/vercel/next.js.git
cd next.js/examples/with-emotion
yarn build
yarn && yarn build
- See error:
± yarn build
yarn run v1.22.5
$ next build
info - Using external babel configuration from /path/to/next.js/examples/with-emotion/.babelrc
info - Creating an optimized production build
Failed to compile.
./node_modules/@emotion/react/dist/emotion-element-5144c041.browser.esm.js
Attempted import error: 'createContext' is not exported from 'react'.
> Build error occurred
Error: > Build failed because of webpack errors
at build (/path/to/next.js/examples/with-emotion/node_modules/next/dist/build/index.js:15:918)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected behavior
Should build .next/*
without error
Screenshots
None
System information
- OS: macOS
- Browser: None
- Version of Next.js: 10.0.3 (10.0.5, still happening)
- Version of Node.js: 14.15.1
- Deployment: None
Additional context
The build was successful when back to here; https://github.com/merceyz/next.js/tree/ac34a9f960b85fa074726b5f1970dd0c20600752/examples/with-emotion
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Error Codes | Yarn - Package Manager
A list of Yarn's error codes with detailed explanations. ... Two packages with build scripts have cyclic dependencies. Cyclic dependencies are a can...
Read more >Getting an error during yarn build in React JS - Stack Overflow
I had to downgrade some @Babel libraries. Found the solution from here. Basically, add this to the dependencies in your package.json: "@babel/ ...
Read more >Setup Emotion to use Tailwind classes in Next.js - Code Daily
We'll examine how we can use Emotion, Tailwind and Babel to build out string validated Tailwind classes but leverage the power of Emotion....
Read more >this jsx tag's 'children' prop expects a single child of type ... - You.com
I had this same problem for my component when I try to pass single child to array of children type. We can avoid...
Read more >Strange build error with yarn add - beginner - ReScript Forum
I'm stuck in a very strange error that completely prevents me from building a rescript react application. Why or how this error happens...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI
I found that this issue happens only when
NODE_PATH=./
Build succeed when I setNODE_PATH=''
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.