Open Pedneri1 opened 4 years ago
me too , i have blank page with no console log
. i have try default react project and deploy is fine , nothing wrong.
but with this template, why i got blank page .
in localhost is fine
but deploy server is blank page
have try with default package.json still blank and try modif the file still blank ...
package.json
{
"name": "shards-dashboard-lite-react",
"version": "1.0.0",
"private": true,
"homepage": "./",
"dependencies": {
"axios": "^0.19.2",
"camelize": "^1.0.0",
"chart.js": "^2.7.3",
"classnames": "^2.2.6",
"cross-env": "^5.2.0",
"dateformat": "^3.0.3",
"flux": "^3.1.3",
"lodash.find": "^4.6.0",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-ga": "^2.5.6",
"react-quill": "^1.3.3",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"shards-react": "^1.0.0",
"shortid": "^2.2.14"
},
"scripts": {
"start": "react-scripts start",
"build:prod": "npm run build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Hello guys! I have the same issue but in my case I saw in the console an error that said
unexpected token '<'
BTW my app ran perfectly the first time it was loaded, then if I reload the page I just saw a blank page
I did the following and it works!! in the package.json I just deleted the
"homepage": "./",
and change the build script to:
"build": "react-scripts build",
With that changes my package.json was like this:
{
"name": "my-app",
"version": "1.0.0",
"private": true,
"dependencies": {
"@stripe/react-stripe-js": "^1.1.2",
"@stripe/stripe-js": "^1.11.0",
"firebase": "^8.0.1",
"flux": "^3.1.3",
"lodash.find": "^4.6.0",
"moment": "^2.29.1",
"node-sass": "4.14.1",
"react": "^16.6.3",
"react-datepicker": "^3.4.1",
"react-devtools": "^4.10.1",
"react-dom": "^16.6.3",
"react-redux": "^7.2.2",
"react-router-dom": "^5.1.2",
"react-scripts": "2.1.1",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"shards-react": "^1.0.0"
},
"scripts": {
"dev": "react-scripts start",
"build:prod": "npm run build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"reactide-server": "webpack-dev-server --config reactide.config.js --mode development --hot"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"@babel/helper-regex": "^7.10.5"
}
}
(I also deleted all my comments in JSX, because in the build folder one of the js files has to many errors related with JSX comments)
Hope this can help someone, at least it works for me :D
After cloning the repo, making the changes on .gitmodules told by @design-revision here and npm installing the dependencies the build results in a blank screen:
The console output for the build is:
the build folder has these files:
The generated index.html looks like this:
And the Chrome console output is empty. What is going on ? Am I doing something wrong ?