0

I try to add http.get to my angular app. Right now it is very small and I am only prove functionality. So I am a beginner with Angular. The app run fine till I try to add http.get function. I test if the app run again if I remove only http.get request. It did not. I have to remove all other functions like error Handler function. Angular says the app was build successful. But the browser console return the error:

15:29:48.530 Error: @http://localhost:4200/system-config.js:35:5
    Call@http://localhost:4200/vendor/es6-shim/es6-shim.js:289:14
    forEach@http://localhost:4200/vendor/es6-shim/es6-shim.js:1295:14
    @http://localhost:4200/system-config.js:34:1
    Zone</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:4200/vendor/zone.js/dist/zone.js:323:20
    Zone</Zone</Zone.prototype.run@http://localhost:4200/vendor/zone.js/dist/zone.js:216:25
    scheduleResolveOrReject/<@http://localhost:4200/vendor/zone.js/dist/zone.js:571:53
    Zone</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:4200/vendor/zone.js/dist/zone.js:356:24
    Zone</Zone</Zone.prototype.runTask@http://localhost:4200/vendor/zone.js/dist/zone.js:256:29
    drainMicroTaskQueue@http://localhost:4200/vendor/zone.js/dist/zone.js:474:26
    ZoneTask/this.invoke@http://localhost:4200/vendor/zone.js/dist/zone.js:426:22

    Evaluating http://localhost:4200/system-config.js
    Error loading http://localhost:4200/system-config.js1zone.js:323:20
Zone</ZoneDelegate</ZoneDelegate.prototype.invoke()zone.js:323
Zone</Zone</Zone.prototype.run()zone.js:216
scheduleResolveOrReject/<()zone.js:571
Zone</ZoneDelegate</ZoneDelegate.prototype.invokeTask()zone.js:356
Zone</Zone</Zone.prototype.runTask()zone.js:256
drainMicroTaskQueue()zone.js:474
ZoneTask/this.invoke()zone.js:426

I never opend the bowser console before, because the app runs well. I removed all functions I added with http.get. But now I get same error. I closed the browser console and the app was runing well again. If I open console after the app was loaded there are no error messages. When I opened before it stops with the error messages above. I do not understand why or what is wrong with system-config.js. I never changes that file, it was auto created by angular cli.

Line 35 in system-config.js is:

    cliSystemConfigPackages[barrelName] = { main: 'index' };
CordlessWool
  • 1,388
  • 4
  • 17
  • 35

1 Answers1

0

I do not really know why the error message appears why the error message appears when developer tool is open in Firefox. Chromium doesn't and Firefox does only if console is opened before loading.

But the error with http was an other. I found a solution here: Angular 2 No provider for Http

Community
  • 1
  • 1
CordlessWool
  • 1,388
  • 4
  • 17
  • 35