我如何查看此Reactjs调试映像中的错误位置

问题描述

我一直在得到这个屏幕,它总是停在Main.Chunk.js上,如图片所示

我是Reactjc的新手,如果由于

而发生这种情况,我将无法化妆

未捕获的SyntaxError:意外令牌'

这也显示在图像上,或者还有其他原因。

任何建议的帮助都会很酷!

enter image description here

更新

当我删除该图中突出显示的4个脚本行时,错误

未捕获的SyntaxError:意外令牌'

走开!

enter image description here

然后将执行挂在这里

enter image description here

解决方法

我找到了this解决方案。

基本上,您可以尝试更改此内容:

app.use(express.static('client/build'));
app.get("*",(req,res) => {
    res.sendFile(require('path')
        .resolve(__dirname,'client','build','index.html'));
})

收件人:

const root = require('path').join(__dirname,'build')
app.use(express.static(root));
app.get("*",res) => {
    res.sendFile('index.html',{ root });
})