Issue In Deployment Of React App In Netlify
I am trying to deploy react application in netlify as referred from the medium link: https://link.medium.com/nw9ZCh0lrV so I used express server to define build scripts and settin
Solution 1:
A common mistake in a create react app
is to add a homepage
in the package.json
file that does not match your site location. Once you do a production build, the assets are prepended with the value of any path after the domain.
https://nostalgic-euclid-4f95ab.netlify.com/codehangar/react-interview/static/js/main.7ab6795d.chunk.js
From the look of the path of the broken (404) asset, your homepage value looks something like:
"homepage": "https://example.com/codehangar/react-interview",
If you are going to include a homepage value, make sure it is the same as your site URL.
In your case the value should be:
"homepage": " https://nostalgic-euclid-4f95ab.netlify.com",
Note:* Typically, leave this setting out of the file until you are live and have your domain set.
Also:
- No need to store the build folder in your repository (.gitignore). The build command will replace it on each deploy.
- You will not need the
server.js
file you supplied.
Solution 2:
Try using manual uploading the build file
on netlify drop
Post a Comment for "Issue In Deployment Of React App In Netlify"