We have an Aurelia SPA that is served from a .NET MVC application. The SPA is bundled using Webpack.
Under certain conditions seemingly random JavaScript functions and objects will be undefined. We are unable to navigate to certain routes because of this. Refreshing the browser fixes these issues.
The steps we have found to reproduce this behavior are not always reliable.
- The SPA is open in the browser (specifically Chrome in this case).
- We deploy a new version of the code to our server; .NET and JavaScript.
- The previously open browser stays open for about 12 hours
Then we will see the issues like this Cannot read property 'split' of undefined
. when navigating to certain routes. The undefined objects preventing route navigation are not always the same.
I cannot reproduce this behavior on my localhost.
Without deploying new code, I have left my browser open over a weekend and returned to a functioning application.
Any suggestions would be greatly appreciated. I am unsure how the deploy can be related since the browser should be unaware of any server changes.