Search code examples
reactjswindowsiisweb-applicationsserver

Reactjs app deployed in windows server. Blank white page displayed


I created an ReactJS APP. I want to deploy this app in hosted server. So i made the changes as

  1. In package.json add "home": 'https://ww.domain.com/ReactApp"
  2. Installed react-snapshot plugin. Added "&& react-snapshot" in build line in package.json. Replace React-Dom to react-snapshot in index.js.
  3. Build the project and copy the files and folders inside build and paste inside server inetpub/wwwroot/reactApp folder.
  4. Run the application favicon displayed in tab. Blank white screen. No error in console.

Anybody please suggest what mistake am i doing and please suggest quick solution. Thanks


Solution

  • You can try the following steps to fix your question:

    1.Please check your Webpack’s publicpath setting. There is the publicPath setting in your Webpack configuration to tell an app what its root path is. please make sure it is set correctly, it will base links like above from that URL.

    2.If you’re using create-react-app, you won’t have to deal with Webpack configs. The way how create-react-app has it’s webpack configuration set up, this will replace the publicPath with the correct base URL for your app. Now your app it’s base URL, run npm run build again and copy the app to your web space to find your app up and running.