I am getting error in console “You need to enable JavaScript to run this app.” reactjs

前端 未结 8 507
北海茫月
北海茫月 2020-12-06 08:57

I am new to reactjs, I am working on a app. It was running fine, but when I\'ve run npm run build command, I am getting error "You need to enable JavaScript to run this

相关标签:
8条回答
  • 2020-12-06 09:49

    I had same problem. My workable solution:

    package.json:

    "homepage": "."
    

    index.js:

    app.use(express.static(__dirname)); //here is important thing - no static directory, because all static :)
    
    app.get("/*", function(req, res) {
      res.sendFile(path.join(__dirname, "index.html"));
    });
    
    0 讨论(0)
  • 2020-12-06 09:50

    I had the same problem. In my case, the class name wasn't following the patterns (must starts with uppercase). As soon as I corrected it everything started to work well.

    0 讨论(0)
提交回复
热议问题