When I execute ionic serve, it shows the following errors:
Refused to load the image 'http://localhost:8100/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
Failed to load resource: the server responded with a status of 404 (Not Found)
How can I solve this?
By default, ionic serve boots up a development server on localhost . To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address(es) on which your app is being served. Try the --lab option to see multiple platforms at once. ionic serve uses the Angular CLI.
If you want to specify the ports themselves, you can pass additional option arguments when you run ionic serve like — port|-p for an specific web server port. If you try ionic serve -p 8200 -i 35730, the app runs perfectly with the custom web server and livereload port in your browser.
To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address (es) on which your app is being served. Try the --lab option to see multiple platforms at once. ionic serve uses the Angular CLI. Use ng serve --help to list all Angular CLI options for serving your app.
By default, ionic serve boots up a development server on all network interfaces and prints the external address (es) on which your app is being served. It also broadcasts your app to the Ionic DevApp on your network. To disable the DevApp and bind to localhost, use --local. Try the --lab option to see multiple platforms at once.
Easily spin up a development server which launches in your browser. It watches for changes in your source files and automatically reloads with the updated build. By default, ionic serve boots up a development server on all network interfaces and prints the external address (es) on which your app is being served.
The shell no longer recognizes the "ionic" command. That was the result of an aborted installation. Now fixed. Serve.loadSettings - You must pass a project object to pull out project specific settings from
I had the same error message.
Looking through the logs printed when doing
ionic serve
showed me a bunch of errors, all similar to this
[ng] ERROR in ./src/global.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Cannot find module 'node-sass'
[ng] Require stack:
This lead me to get the application up and running again by
npm install node-sass --save
The compilation process is sometimes spitting out rather confusing error messages from time to time, but with a little digging one can start guessing where to start poking
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With