React webapp - each source file rendering index.html source

0

I have a react web application that builds to a "dist" directory containing all assets. I am using a ELB build with Node.js and nginx, all default settings. The app successfully starts however when I load the page, all of the page assets e.g. js and css files do not render.

Inspecting the source of these files, they do not fail to load, however the source of each returns the html source of the home page, rather than their respective css and js contents.

This indicates some sort of proxy or rewrite issue im guessing but have no idea how to resolve.

Appreciate any guidance.

UPDATE: I can see nginx and node running using 80 and 8081 respectivley:

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6962/nginx: master
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 7061/node

wonka
demandé il y a 4 ans204 vues
1 réponse
0

Turns out there was a problem with my react build and the static assets were not being served correctly.

wonka
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions