React site is displaying JS source code instead of executing

This is a test of a react site. When you go to that URL the JS file just shows the source of it instead of executing. Is there something else needed to get it working?

@spudMan This seems to be a pretty fundamental misunderstanding of how JavaScript works in a browser.

If you directly access any JavaScript file on the internet it will just appear as plain text in your browser.

For example pressing “view source” on this exact page, and going to one of the scripts running this forum:

You will need a html file, with a <script> tag, see:


1 Like