React - Minified exception occurred

前端 未结 10 1418
离开以前
离开以前 2020-12-09 07:54

I have React js installed via NPM and using browserify to manage components in react. When an exception occurs in React, the console shows as

\"Uncau

相关标签:
10条回答
  • 2020-12-09 08:19

    use the min.js files in production or bundle your application code with process.env.NODE_ENV === 'production' and you should be good to go!

    0 讨论(0)
  • 2020-12-09 08:20

    As of version 15.2, production React error messages (NODE_ENV=production) now include a URL that you can visit where you can see the original, unobfuscated error.

    https://twitter.com/dan_abramov/status/748969886433546240

    You should consider upgrading to React 15.2 in order to get access to these error messages. Additionally, some production crash reporting tools automatically unminify these errors for you.

    0 讨论(0)
  • 2020-12-09 08:23

    If your package.json scripts has dll, try exec npm run dll or yarn run dll.

    0 讨论(0)
  • 2020-12-09 08:27

    Have you check the DOM element that you are trying render ? I had this error before due to a silly mistake. The worst part is bundle was minified. The element id is not same

    Index.html

    <div id="ds-app"></div>
    

    app.jsx

    React.DOM.render(<App/>, document.getElementById('app'))
    
    0 讨论(0)
提交回复
热议问题