1
votes

I uploaded angular app "dist" folder into Azure blob storage.
I can run index.html from inside the blob, and it will run application.
Now, I want to create some Azure proxy function that will redirect to this blob and will run angular app.
But when I run this proxy, I get exception:

error_handler.js:48 EXCEPTION: Uncaught (in promise): SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'StorageUrl/ContainerName/' cannot be created in a document with origin 'FunctionUrl' and URL 'FunctionUrl/ContainerName'. Error: Failed to execute 'replaceState' on 'History': A history state object with URL 'StorageUrl/ContainerName/' cannot be created in a document with origin 'FunctionUrl' and URL 'FunctionUrl/ContainerName'.

Does anyone saw this error?

1

1 Answers

0
votes

I am able to reproduce the error which is more about Angular's issue. The official doc says:

The router uses the browser's history.pushState for navigation. Thanks to pushState, you can make in-app URL paths look the way you want them to look, e.g. localhost:3000/crisis-center. The in-app URLs can be indistinguishable from server URLs.

And from Mozilla pushState documentation:

The new URL must be of the same origin as the current URL; otherwise, pushState() will throw an exception.