2017-05-25 113 views
1

我將角度應用程序「dist」文件夾上傳到Azure blob存儲。
我可以從blob中運行index.html,它會運行應用程序。
現在,我想創建一些Azure代理函數,它將重定向到此Blob並運行角度應用程序。
但是當我運行這個代理,我得到異常:使用angular2應用程序使用Azure blob存儲和Azure代理功能

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'.

有誰看到了這個錯誤?

回答

0

我能夠重現更多關於Angular問題的錯誤。該official doc說:

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.

而且從Mozilla pushState documentation

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