Linux azure web app can’t find assets files, React app

  Kiến thức lập trình

I’m deploying a React app to an Azure Web App on Linux. Node v20.
Release pipeline is working good. I’ve even
deleted files via scm.azurewebsites.net/webssh/host and re-deploy, it works.
But, when try to navigate to my app, it does not load. It appears like if site were new, with the microsoft presentation page.

Then I tried to see advanced tools->site wwwroot but instead of reporting files on wwwroot directory, try to load my app with two errors on browser develop tools console:

mysite.scm.azurewebsites.net/assets/index-Taz5NJvN.js
net::ERR_ABORTED 404 (Not Found)

I’ve noticed that it loads the index.html, because it changes the title of the web page, to my app title.

I’ve inspected wwwroot directory via azure -> development tools ->ssh and the assets directory there contains those files.

I’ve been searching and googleing, but with no luck at all.
I’ve used “pm2 serve /home/site/wwwroot –no-daemon –spa” and “npx serve -s” in startup command also, the app was created with Vite.
If somebody can help me to get this app running would appreciate it.

LEAVE A COMMENT