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.

2
  • Did you try dropping your build folder onto your web host? Commented Feb 25, 2019 at 15:15
  • Do you mean to copy it to "C:\inetpub\wwwroot"? Did that, made not difference. Commented Feb 25, 2019 at 18:02

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.