我在 MERN 堆栈中使用 MongoDB、Express、React、Nodejs 构建了 WebApp。
我将它作为https://connectgeeks.herokuapp.com托管到 Heroku-Cloud 。
项目的Github-repo - Find_Geeks。它适用于我的桌面浏览器,但不能在任何 Android chrome 上运行。
我在 Heroku 云中有一个自动构建应用程序,其中 package.json 中的命令为
"scripts:{
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm run build --prefix frontend"
}
当它在 android 上加载时,它的搜索栏背景变为黑色,我假设页面已加载,但无法显示组件。
Desktop-chrome的屏幕截图,处于工作状态。
Desktop-chrome 的屏幕截图,在隐身模式下,工作状态。
chrome中Mobile-mode的截图,工作状态。
我的package.json
内容是
{
"name": "find-geeks",
"version": "1.0.0",
"description": "social media for developers, quite same as Linkedin.",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix frontend",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix frontend",
"dev": "concurrently \"npm run server\" \"npm run client \"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm run build --prefix frontend"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ganesh-deshmukh/connect-geeks.git"
},
"author": "Ganesh Ashok Deshmukh",
"license": "MIT",
"bugs": {
"url": "https://github.com/ganesh-deshmukh/connect-geeks/issues"
},
"homepage": "https://github.com/ganesh-deshmukh/connect-geeks#readme",
"dependencies": {
"bcryptjs": "2.4.3",
"body-parser": "1.18.2",
"concurrently": "3.5.1",
"express": "4.16.3",
"gravatar": "1.6.0",
"jsonwebtoken": "8.2.0",
"mongoose": "5.4.0",
"passport": "0.4.0",
"passport-jwt": "4.0.0",
"validator": "9.4.1"
},
"devDependencies": {
"nodemon": "1.17.3"
}
}
编辑1:
我尝试通过 localhost-server 在移动屏幕上调试 url http://192.168.43.171:3000/
,
然后它显示错误位置为,
从 store.js 中删除了 DevTools,现在它可以通过 localhost-server 在移动浏览器上运行。
也许这是由于 Heroku-build 脚本或任何其他原因。
它在删除 redux-dev-tools 后就可以在移动屏幕上运行,就像在本地一样。