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.

ReferenceError: React is not defined

See original GitHub issue

Hello, I testing my react application with Mocha and when I run npm test I got the exception: `app/DOM/pure/landing-assets/logo.svg:3 React.createElement( ^

ReferenceError: React is not defined`

How I can solve this problem?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
princedcommented, Jun 14, 2016

@whois42 Have you solved the issue? Is there some info for people who may encounter it too?

1reaction
antonydbcommented, Jun 22, 2017

If anyone ends up here like I did, this might be helpful https://github.com/jhamlet/svg-react-loader/issues/31.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught ReferenceError: React is not defined
Possible reasons are 1. you didn't load React.JS into your page, 2. you loaded it ...
Read more >
Getting "Uncaught ReferenceError: react is not defined".
Hi Louie Ambriz, It's hard to tell without seeing your code but it sounds like React is not being loaded into your project....
Read more >
[v4]ReferenceError: React is not defined · Issue #9882
I have submitted PR #9885 to fix this. This is because the jsx-runtime configuration gets removed webpack config during the ejection process ......
Read more >
Frequently Asked Questions
I see ReferenceError: React is not defined when using storybooks with Next.js. Next automatically defines React for all of your files via a...
Read more >
React is not defined after migrating to React 17 - help
Hello, I migrated to React v17. I know that now it is not necessary to import React from 'react'; so I deleted it...
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