user1688401
user1688401

Reputation: 1871

Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings

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

Upvotes: 6

Views: 19275

Answers (2)

JupiterAmy
JupiterAmy

Reputation: 384

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>

Upvotes: -1

Ben Vinegar
Ben Vinegar

Reputation: 307

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

Upvotes: 2

Related Questions