React - Minified exception occurred

前端 未结 10 1446
离开以前
离开以前 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:10

    I had this issue, and for me I didn't need to disable minification or use react source. My script was just loading before the root element. So I just moved the script out of the head and below the div in the index file source code and that fixed it.

    Changed my index.jade from this:

    html
     head
       title Super coo site
       script(src="bundle.js")
     body
       div#root
    

    To this:

    html
     head
       title Super coo site
     body
       div#root
       script(src="bundle.js")
    

提交回复
热议问题