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.

create-react-app failed to compile

See original GitHub issue

Current behavior:

When npm install @emotion/core and/or @emotion/styled after setting up a typescript project with create-react-app the app failed to compile even though I didn’t import emotion in the project.

To reproduce:

  1. npx create-react-app vz-app --template typescript
  2. npm install --save @emotion/core @emotion/styled

Expected behavior:

Should render the create-react-app landing page correctly.

Environment information:

  • react version: 16.12.0
  • @emotion/styled version: 10.0.23

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
Andaristcommented, Dec 5, 2019

I think this just is caused by a fact that you install extra dependencies with npm, while the existing node_modules has been created with yarn. It’s some kind of a mismatch between those 2 installs - if I remove all node_modules & lock files and do a fresh npm install (which includes already added emotion dependencies) then everything works OK.

6reactions
tosiek88commented, Sep 27, 2020

npm i @types/react and npm i @types/react-dom removing the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app "Failed to compile" on start up - Stack Overflow
I'm new to React and I have had no problems the past few days doing the command line to make a new app....
Read more >
Why my React App Failed To Compile - Timonwa's Notes
Bugs and Errors will come in different shapes and sizes, styles and formats you never expect, causing your react app not to compile....
Read more >
react-scripts fails to build project with Node 17 #11562 - GitHub
Describe the bug we have a CRA app, it used to build with Node 14.x very fine, today I upgrade nodejs to 17.0.0...
Read more >
"Failed to compile" error for any eslint error. i would like to not ...
I will assume you're using create-react-app. If you really want to disable eslint put “DISABLE_ESLINT_PLUGIN=true” in a .env file at your ...
Read more >
Troubleshooting - Create React App
Check that your file is imported by your entrypoint. TypeScript will show errors on any of your source files, but webpack only reloads...
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