我正在使用 Heroku 部署一个 React 和 Node js 网站。 Heroku 说部署成功但没有在屏幕上显示前端部分。 (显示图标)
这是我在控制台中得到的错误。当我在 mi pc 中使用客户端运行 npm start 时,它可以工作,但不能在服务器上运行。 在heroku中不显示前端所以我不知道服务器怎么样
react-dom.production.min.js:216 Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at b (react.production.min.js:18)
at t.useMemo (react.production.min.js:23)
at r (I18nextProvider.js:7)
at In (react-dom.production.min.js:157)
at Ys (react-dom.production.min.js:267)
at ua (react-dom.production.min.js:250)
at la (react-dom.production.min.js:250)
at ia (react-dom.production.min.js:250)
at _r (react-dom.production.min.js:243)
at Hr (react-dom.production.min.js:237)
react-dom.production.min.js:260 Uncaught Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at b (react.production.min.js:18)
at t.useMemo (react.production.min.js:23)
at r (I18nextProvider.js:7)
at In (react-dom.production.min.js:157)
at Ys (react-dom.production.min.js:267)
at ua (react-dom.production.min.js:250)
at la (react-dom.production.min.js:250)
at ia (react-dom.production.min.js:250)
at _r (react-dom.production.min.js:243)
at Hr (react-dom.production.min.js:237)
这里有来自服务器的包 json:
{
"name": "uep",
"version": "1.0.0",
"description": "",
"main": "prueba.js",
"engines": {
"node": "v14.15.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js",
"build": "cd client && npm install && npm run build",
"server": "nodemon index.js --ignore client"
},
"author": "",
"license": "ISC",
"devDependencies": {
"nodemon": "^2.0.7"
},
"dependencies": {
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-fileupload": "^1.2.1",
"heroku": "^7.52.0",
"mongod": "^2.0.0",
"mongodb": "^3.6.3",
"mongoose": "^5.11.14",
"multer": "^1.4.2",
"nodemailer": "^6.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
这里有来自客户端的 package.json
{
"proxy": "http://localhost:3001/",
"name": "uep-page",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.21.1",
"bootstrap": "^4.6.0",
"emailjs-com": "^2.6.4",
"i": "^0.3.6",
"i18next": "^20.1.0",
"react": "^17.0.1",
"react-bootstrap": "^1.5.1",
"react-classes": "^1.1.1",
"react-hook-form": "^7.1.0",
"react-i18next": "^11.8.11",
"react-pdf": "^5.2.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-router-hash-link": "^2.4.0",
"react-scripts": "1.1.5",
"react-scroll": "^1.8.2"
},
"scripts": {
"predeploy": "npm run build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"gh-pages": "^3.1.0",
"prettier": "2.2.1"
}
}