5

I get that error in browser console. In package.json I set this

 "start": "set NODE_ENV=development && node dev-server ./webpack/config",

but it still give same error.I look for minified or min JS file but I can not find any file.It just find this in project import React from 'react';

How can I handle that error?How can I use non minified react file? I am new in NodeJS

user1688401
  • 1,851
  • 8
  • 47
  • 83

2 Answers2

2

React minifies errors for production builds in order to preserve filesize.

It looks like, despite you setting NODE_ENV=development, you are somehow generating a production build (probably set somewhere in your webpack config file).

You can either figure out how to generate a proper development build (which will output the original error string), or upgrade to React 15.2, whose error strings now include a URL where you can view the original unobfuscated error: https://twitter.com/dan_abramov/status/748969886433546240

Ben Vinegar
  • 307
  • 1
  • 8
-1

Try to check the target div element in your HTML file. suppose if you have this code in your app.js file

ReactDOM.render(jsx, document.getElementById('app'));

Then the second parameter should exactly match with the target element in your HTML like this

    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
</head>
<body>
    <div id="app"></div>
    <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="/scripts/app.js"></script>
</body>
</html>
JupiterAmy
  • 374
  • 2
  • 11