You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A ng build generates a dist/index.html. Running this file in your browser (aka file:///home/.../index.html) might seem intuitive but will not work (reason: cannot issue XHR requests).
However, the error message is not helpful at all, saying nothing but
EXCEPTION: Uncaught (in promise): SecurityError: The operation is insecure.
BrowserPlatformLocation.prototype.replaceState@file:///home/phi/d/ls/repo/web/dist/vendor.bundle.js:22446:13
Desired functionality.
Any hint to solve this error would be helpful.
Note: For local testing, I then set up an apache server inside the dist directory: php -S localhost:9090 -t . -c "/etc/php/7.0/apache2/php.ini"'. Seemed quickest to me.
The text was updated successfully, but these errors were encountered:
you can install the npm package http-server globally. Then you can spin up a simple http-server in any directory you like, no need for a full blown Apache:
npm i -g http-server
Then use
http-server -o -c-1
in any directory. The -o option opens a browser automatically and -c-1 disables http caching.
Bug Report or Feature Request (mark with an
x
)Versions. (latest, 4.0)
@angular/cli: 1.0.0-rc.2
node: 6.10.0
os: linux x64
@angular/animations: 4.0.0-rc.3
@angular/common: 4.0.0-rc.3
@angular/compiler: 4.0.0-rc.3
@angular/compiler-cli: 4.0.0-rc.3
@angular/core: 4.0.0-rc.3
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.0.0-rc.3
@angular/http: 4.0.0-rc.3
@angular/platform-browser: 4.0.0-rc.3
@angular/platform-browser-dynamic: 4.0.0-rc.3
@angular/platform-server: 4.0.0-rc.3
@angular/router: 4.0.0-rc.3
@angular/cli: 1.0.0-rc.2
@ngtools/webpack: 1.2.13
Repro steps.
A
ng build
generates adist/index.html
. Running this file in your browser (akafile:///home/.../index.html
) might seem intuitive but will not work (reason: cannot issue XHR requests).However, the error message is not helpful at all, saying nothing but
Desired functionality.
Any hint to solve this error would be helpful.
Note: For local testing, I then set up an apache server inside the
dist
directory:php -S localhost:9090 -t . -c "/etc/php/7.0/apache2/php.ini"'
. Seemed quickest to me.The text was updated successfully, but these errors were encountered: