0

I'm trying to host a React.js application, created with create-react-app (react-scripts v2.1.5), on IIS.

I keep getting the following type errors:

browser console output


I've tried everything mentioned in this question, to no avail: create-react-app on IIS 10

Hosting it with "serve -s build" as suggested by CRA's build script works fine, but I want to host it through IIS.

Is there anything obvious I'm missing? Any help would be greatly appreciated.

Community
  • 1
  • 1

1 Answers1

0

It turns out the solution was to add "homepage": "." to my project's package.json file.

Here are some links for further information:

https://facebook.github.io/create-react-app/docs/deployment#building-for-relative-paths

https://github.com/facebook/create-react-app/issues/1487

https://github.com/facebook/create-react-app/issues/1480

https://github.com/facebook/create-react-app/issues/1094

https://github.com/facebook/create-react-app/pull/1489

  • Just to provide more context, the issue I was encountering was because my project was not hosted at the root, but under an alias. That's why I had to add the homepage setting to specify a relative path to resources. – André Engelbrecht Feb 26 '19 at 09:50