Mike Singh
Mike Singh

Reputation: 23

Deploying React JS on IIS

Issue: I'm trying to deploy my react js project on iis and it just loads a blank page.

Info: In order to deploy application, I ran npm run build to create a production build and then set up the site through IIS pointing to build folder. From debugging mode in the browser it looks like its not loading some of the js files:

Screenshot of Errors: https://i.sstatic.net/Fwdf6.jpg

Does anyone have any tips on how to solve this issue?

Upvotes: 1

Views: 4127

Answers (1)

Mike Singh
Mike Singh

Reputation: 23

Solution :

  1. Delete current production build folder
  2. Add "homepage": ".", in the package.json file as advised in stackoverflow.com/q/55568697/6281832 .
  3. Open a cmd and type "npm run build" to create a new production build
  4. Deploy build as indicated in React Deployment on IIS server
  5. Enjoy your live site :)

Upvotes: 1

Related Questions