aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.03k stars 518 forks source link

Publish to Azure WebApp succeeds, but SPA never starts #1140

Closed docrinehart closed 7 years ago

docrinehart commented 7 years ago

After deploying to Azure from VisualStudio 2017, I can reach my azure website and see the "Loading..." html page that bootstraps my react/redux application. However, the javascript doesn't ever kickoff the Single-Page App, and there are no errors I see in the js browser console or in the azure logs. I'm not exactly sure where to start debugging this and can't seem to find any related issues googling around.

My app is based around the yeoman generator for aspnetcorespa, so I am planning to try and deploy the base app template from a fresh generation to see if I experience the same problem. This will help me determine if it's the app or Azure, but I have the feeling it's on the app side -- in which case I'm not sure exactly what to start looking at since I have no errors to work with. I did update the Node appsetting in Azure to ensure I'm running the same version of node that I am locally (7.5.0) and confirmed it was up-to-date in the Azure console. I also can see the main-client and vendor js files are being pulled down when the page loads.

Everything runs fine locally, only seeing this once it's deployed to Azure.

SteveSandersonMS commented 7 years ago

I'm not sure where to start with helping with this. I know for certain that the latest templates in the repo do deploy to Azure correctly, because we're in the middle of a massive verification process running up to the ASP.NET Core 2.0 release, and dozens of people have been verifying things like this every couple of days.

So, I'm not sure what's different with the template you're using or with your Azure deployment method. Since there seems to be a client-side issue (i.e., you're seeing Loading..., and can observe the browser fetching some .js files), I'd suggest you use the browser debug tools to figure out exactly where the app startup does not work (if it downloads a .js file due to a <script> tag, it must at least try to execute it, so it would be possible to step through the execution to find out where it goes wrong). I'm very surprised there isn't at least a console error. If you post the URL of your deployed app, I could have a look to see if there's a client-side issue preventing it from loading.

If you track this down and discover there's a bug somewhere in the code in this repo, please let us know! In the meantime I'll close this because I know it does work with the latest SPA templates (not necessarily those on Yeoman, but rather those in the latest .NET Core 2.0 Preview 3 SDKs).

docrinehart commented 7 years ago

After some digging it looks like the deployed version is trying to use the redux store I have set up for dev instead of prod and attempting to start HMR unsuccessfully. After debugging it I started getting the error in the console, but not before that... Chome DevTools issue maybe? Or something fluky... I don't know, but at least I have a better starting place now. Thanks.