question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

with-emotion throws an error during `yarn build`

See original GitHub issue

Bug 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:

  1. git clone https://github.com/vercel/next.js.git
  2. cd next.js/examples/with-emotion
  3. yarn build yarn && yarn build
  4. 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
okmttdhrcommented, Feb 2, 2021

FYI

I found that this issue happens only when NODE_PATH=./ Build succeed when I set NODE_PATH=''

0reactions
balazsorban44commented, Jan 28, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found