[Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: Not Found - google-maps

I am trying to develop an app using ionic 4, angular 6, Nodejs 10 and need to integrate google maps. When I run my app, I always see this error in the dev tools browser console - [Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: Not Found. Copied the full console at the end.
Following is the code I have -
app.module.ts
import { NgModule } from '#angular/core';
import { BrowserModule } from '#angular/platform-browser';
import { RouteReuseStrategy } from '#angular/router';
import { IonicModule, IonicRouteStrategy } from '#ionic/angular';
import { SplashScreen } from '#ionic-native/splash-screen/ngx';
import { StatusBar } from '#ionic-native/status-bar/ngx';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { GoogleMaps } from '#ionic-native/google-maps';
#NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule
],
providers: [
StatusBar,
GoogleMaps,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
],
bootstrap: [AppComponent]
})
export class AppModule {}
Following is my app.component.ts file -
import { Component, ViewChild } from '#angular/core';
import { Platform, Nav } from '#ionic/angular';
import { SplashScreen } from '#ionic-native/splash-screen/ngx';
import { StatusBar } from '#ionic-native/status-bar/ngx';
import { HomePage } from './home/home.page';
#Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
#ViewChild(Nav) nav: Nav;
rootPage: any;
public appPages = [
{
title: 'Home',
url: '/home',
icon: 'home'
},
{
title: 'List',
url: '/list',
icon: 'list'
}
];
constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar
) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.rootPage = HomePage;
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
}
home.page.ts
import { Component, OnInit } from '#angular/core';
import { GoogleMaps, GoogleMap } from '#ionic-native/google-maps/ngx';
import { Platform } from '#ionic/angular';
import { Environment } from '#ionic-native/google-maps';
#Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {
map: GoogleMap;
constructor( private platform: Platform) {}
async ngOnInit() {
await this.platform.ready();
await this.loadMap();
}
loadMap() {
Environment.setEnv({
'API_KEY_FOR_BROWSER_RELEASE': 'Agktkllffff1xGYLjDF0v1i2RSDrqDLjEmDdLI',
'API_KEY_FOR_BROWSER_DEBUG': ''
});
this.map = GoogleMaps.create('map_canvas');
}
}
home.page.html
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>
Home
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<h3>GoogleMaps</h3>
<div id = "map_canvas">
<button ion-button (click)="onButtonClick($event)">Demo</button>
</div>
</ion-content>
I checked my Google Map API key and it doesn't has problem and double checked that I am using the correct one. My account is also fine and shouldn't be a problem with that. I am wondering what is causing this issue. The command that I am using to run my application is -
ionic cordova run browser -l
The url that opens up is http://172.29.54.8:8100/home
console.log error details -
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
cordova.js:1066 deviceready has not fired after 5 seconds.
cordova.js:1059 Channel not fired: onPluginsReady
cordova.js:1059 Channel not fired: onCordovaReady
bootstrap.js:15 Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
(anonymous) # bootstrap.js:15
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask # zone.js:496
ZoneTask.invoke # zone.js:485
timer # zone.js:2054
setTimeout (async)
scheduleTask # zone.js:2075
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask # zone.js:255
scheduleMacroTaskWithCurrentZone # zone.js:1114
(anonymous) # zone.js:2090
proto.(anonymous function) # zone.js:1394
checkReady # bootstrap.js:13
./node_modules/#ionic-native/core/index.js # index.js:11
__webpack_require__ # bootstrap:83
./node_modules/#ionic-native/splash-screen/ngx/index.js # index.js:1
__webpack_require__ # bootstrap:83
./src/app/app.module.ts # app.component.ts:12
__webpack_require__ # bootstrap:83
./src/main.ts # main.ts:1
__webpack_require__ # bootstrap:83
0 # main.ts:12
__webpack_require__ # bootstrap:83
checkDeferredModules # bootstrap:45
webpackJsonpCallback # bootstrap:32
(anonymous) # main.js:1
cordova.js:1024 adding proxy for common
cordova.js:1024 adding proxy for PluginEnvironment
cordova.js:1024 adding proxy for CordovaGoogleMaps
cordova.js:1024 adding proxy for PluginLocationService
cordova.js:1024 adding proxy for PluginGeocoder
cordova.js:1024 adding proxy for StatusBar
cordova.js:1024 adding proxy for Device
cordova.js:1024 adding proxy for SplashScreen
StatusBarProxy.js:23 StatusBar is not supported
zone.js:2969 GET http://172.29.54.8:8100/config.xml 404 (Not Found)
scheduleTask # zone.js:2969
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask # zone.js:255
scheduleMacroTaskWithCurrentZone # zone.js:1114
(anonymous) # zone.js:3001
proto.(anonymous function) # zone.js:1394
readConfig # cordova.js:891
initAndShow # SplashScreenProxy.js:154
(anonymous) # SplashScreenProxy.js:165
build # cordova.js:51
require # cordova.js:66
localRequire # cordova.js:47
exports.mapModules # cordova.js:1352
(anonymous) # cordova.js:1152
f # cordova.js:645
Channel.fire # cordova.js:798
(anonymous) # cordova.js:1144
onScriptLoadingComplete # cordova.js:1574
scriptLoadedCallback # cordova.js:1591
(anonymous) # cordova.js:1545
wrapFn # zone.js:1188
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask # zone.js:496
invokeTask # zone.js:1540
globalZoneAwareCallback # zone.js:1566
error (async)
customScheduleGlobal # zone.js:1666
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
onScheduleTask # zone.js:297
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:401
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleEventTask # zone.js:258
(anonymous) # zone.js:1831
desc.set # zone.js:1244
requireEnsure # bootstrap:145
webpackAsyncContext # .*\.entry\.js$ include: \.entry\.js$ namespace object:780
o # ionic.core.js:6
t.In # ionic.core.js:9
$ # ionic.core.js:6
(anonymous) # ionic.core.js:6
r # ionic.core.js:6
(anonymous) # ionic.core.js:6
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke # zone.js:388
onInvoke # core.js:14060
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke # zone.js:387
push../node_modules/zone.js/dist/zone.js.Zone.run # zone.js:138
(anonymous) # zone.js:872
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
onInvokeTask # core.js:14051
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:420
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
drainMicroTaskQueue # zone.js:595
Promise.then (async)
scheduleMicroTask # zone.js:578
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:410
onScheduleTask # zone.js:297
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:401
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask # zone.js:252
scheduleResolveOrReject # zone.js:862
resolvePromise # zone.js:808
(anonymous) # zone.js:724
webpackJsonpCallback # bootstrap:25
(anonymous) # 12.js:1
cordova.js:866 [Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: Not Found
fail # cordova.js:866
xhrStatusChangeHandler # cordova.js:880
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask # zone.js:496
invokeTask # zone.js:1540
globalZoneAwareCallback # zone.js:1566
load (async)
customScheduleGlobal # zone.js:1666
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleEventTask # zone.js:258
(anonymous) # zone.js:1831
readConfig # cordova.js:886
initAndShow # SplashScreenProxy.js:154
(anonymous) # SplashScreenProxy.js:165
build # cordova.js:51
require # cordova.js:66
localRequire # cordova.js:47
exports.mapModules # cordova.js:1352
(anonymous) # cordova.js:1152
f # cordova.js:645
Channel.fire # cordova.js:798
(anonymous) # cordova.js:1144
onScriptLoadingComplete # cordova.js:1574
scriptLoadedCallback # cordova.js:1591
(anonymous) # cordova.js:1545
wrapFn # zone.js:1188
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask # zone.js:496
invokeTask # zone.js:1540
globalZoneAwareCallback # zone.js:1566
error (async)
customScheduleGlobal # zone.js:1666
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
onScheduleTask # zone.js:297
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:401
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleEventTask # zone.js:258
(anonymous) # zone.js:1831
desc.set # zone.js:1244
requireEnsure # bootstrap:145
webpackAsyncContext # .*\.entry\.js$ include: \.entry\.js$ namespace object:780
o # ionic.core.js:6
t.In # ionic.core.js:9
$ # ionic.core.js:6
(anonymous) # ionic.core.js:6
r # ionic.core.js:6
(anonymous) # ionic.core.js:6
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke # zone.js:388
onInvoke # core.js:14060
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke # zone.js:387
push../node_modules/zone.js/dist/zone.js.Zone.run # zone.js:138
(anonymous) # zone.js:872
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
onInvokeTask # core.js:14051
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:420
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
drainMicroTaskQueue # zone.js:595
Promise.then (async)
scheduleMicroTask # zone.js:578
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:410
onScheduleTask # zone.js:297
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:401
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask # zone.js:252
scheduleResolveOrReject # zone.js:862
resolvePromise # zone.js:808
(anonymous) # zone.js:724
webpackJsonpCallback # bootstrap:25
(anonymous) # 12.js:1
SplashScreenProxy.js:163 [Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: Not Found
(anonymous) # SplashScreenProxy.js:163
fail # cordova.js:869
xhrStatusChangeHandler # cordova.js:880
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask # zone.js:496
invokeTask # zone.js:1540
globalZoneAwareCallback # zone.js:1566
load (async)
customScheduleGlobal # zone.js:1666
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleEventTask # zone.js:258
(anonymous) # zone.js:1831
readConfig # cordova.js:886
initAndShow # SplashScreenProxy.js:154
(anonymous) # SplashScreenProxy.js:165
build # cordova.js:51
require # cordova.js:66
localRequire # cordova.js:47
exports.mapModules # cordova.js:1352
(anonymous) # cordova.js:1152
f # cordova.js:645
Channel.fire # cordova.js:798
(anonymous) # cordova.js:1144
onScriptLoadingComplete # cordova.js:1574
scriptLoadedCallback # cordova.js:1591
(anonymous) # cordova.js:1545
wrapFn # zone.js:1188
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask # zone.js:496
invokeTask # zone.js:1540
globalZoneAwareCallback # zone.js:1566
error (async)
customScheduleGlobal # zone.js:1666
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:407
onScheduleTask # zone.js:297
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:401
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleEventTask # zone.js:258
(anonymous) # zone.js:1831
desc.set # zone.js:1244
requireEnsure # bootstrap:145
webpackAsyncContext # .*\.entry\.js$ include: \.entry\.js$ namespace object:780
o # ionic.core.js:6
t.In # ionic.core.js:9
$ # ionic.core.js:6
(anonymous) # ionic.core.js:6
r # ionic.core.js:6
(anonymous) # ionic.core.js:6
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke # zone.js:388
onInvoke # core.js:14060
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke # zone.js:387
push../node_modules/zone.js/dist/zone.js.Zone.run # zone.js:138
(anonymous) # zone.js:872
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:421
onInvokeTask # core.js:14051
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask # zone.js:420
push../node_modules/zone.js/dist/zone.js.Zone.runTask # zone.js:188
drainMicroTaskQueue # zone.js:595
Promise.then (async)
scheduleMicroTask # zone.js:578
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:410
onScheduleTask # zone.js:297
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask # zone.js:401
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask # zone.js:232
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask # zone.js:252
scheduleResolveOrReject # zone.js:862
resolvePromise # zone.js:808
(anonymous) # zone.js:724
webpackJsonpCallback # bootstrap:25
(anonymous) # 12.js:1
bootstrap.js:10 Ionic Native: deviceready event fired after 15597 ms
StatusBarProxy.js:23 StatusBar is not supported
cordova.js:1024 adding proxy for map_0_605401752643
util.js:225 Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

try {
xhr.open("get", "/config.xml", true);
xhr.send();
} catch(e) {
fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
}
Try to find these lines in cordova.js file of the platform.
I guess your application is in a sub-folder. Hence the error. Change it to
try {
xhr.open("get", "/<foldername>/config.xml", true);
xhr.send();
} catch(e) {
fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
}

I meet the problem when I run command
ionic cordova build browser
and gulp wrong build content to the serve,
wwwunber platforms/browser is the correct one
the wwwunder project folder is wrong one

In my case I am launching my app like the following
http://1.2.3.4/MyApp.BETA/
I think a better approach is to assume current directory instead of root. Therefor the fix should be:
xhr.open("get", "./config.xml", true);
Where is the source of this cordova.js?
Who should be notified to fix this? Cordova?
Thank you.

Related

Uncaught TypeError: $jscomp.inherits is not a function

I'm getting this error while trying to build a Clojurescript project with shadow-cljs. The error is happening with the optimization level set to simple.
The full output in the browser console looks like this:
js.js:74 shadow-cljs - failed to load 34
shadow.js.jsRequire # js.js:74
shadow$provide.<computed> # index.js:5
shadow.js.jsRequire # js.js:66
shadow$provide.<computed> # index.js:8
shadow.js.jsRequire # js.js:66
shadow$provide.<computed> # index.js:6
shadow.js.jsRequire # js.js:66
shadow.js.require # js.js:113
(anonymous) # index.js:2
(anonymous) # append.js:2
js.js:74 shadow-cljs - failed to load 49
shadow.js.jsRequire # js.js:74
shadow$provide.<computed> # index.js:8
shadow.js.jsRequire # js.js:66
shadow$provide.<computed> # index.js:6
shadow.js.jsRequire # js.js:66
shadow.js.require # js.js:113
(anonymous) # index.js:2
(anonymous) # append.js:2
js.js:74 shadow-cljs - failed to load 124
shadow.js.jsRequire # js.js:74
shadow$provide.<computed> # index.js:6
shadow.js.jsRequire # js.js:66
shadow.js.require # js.js:113
(anonymous) # index.js:2
(anonymous) # append.js:2
js.js:74 shadow-cljs - failed to load 148
shadow.js.jsRequire # js.js:74
shadow.js.require # js.js:113
(anonymous) # index.js:2
(anonymous) # append.js:2
index.js:5 Uncaught TypeError: $jscomp.inherits is not a function
at Object.shadow$provide.<computed> (index.js:5)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.<computed> (index.js:5)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.<computed> (index.js:8)
at shadow.js.jsRequire (js.js:66)
at Object.shadow$provide.<computed> (index.js:6)
at Object.shadow.js.jsRequire (js.js:66)
at Object.shadow.js.require (js.js:113)
at index.js:2
shadow$provide.<computed> # index.js:5
shadow.js.jsRequire # js.js:66
shadow$provide.<computed> # index.js:5
shadow.js.jsRequire # js.js:66
shadow$provide.<computed> # index.js:8
shadow.js.jsRequire # js.js:66
shadow$provide.<computed> # index.js:6
shadow.js.jsRequire # js.js:66
shadow.js.require # js.js:113
(anonymous) # index.js:2
(anonymous) # append.js:2
favicon.ico:1 GET http://localhost:8000/favicon.ico 404 (File not found)
I've created an example repo that replicates what I'm seeing as simply as I can here.
I've tried clearing caches and whatnot as described here.
With optimizations set to advanced I don't get this problem but I get other bugs more randomly with harder to read stack traces. Since it seems likely that it's the same problem appearing in different ways and since this is easier to replicate I'm attempting to making things work in simple mode first. The errors I get in the full app with advanced compilation look like this:
core.cljs:2564 Uncaught TypeError: pe is not a function
at Ib (core.cljs:2564)
at Function.wn.b (set.cljs:56)
at Nn.g._update_watching (ratom.cljs:408)
at yn (ratom.cljs:62)
at Qn (ratom.cljs:539)
at c.render (component.cljs:271)
at kg (react-dom.production.min.js:188)
at qi (react-dom.production.min.js:187)
at ak (react-dom.production.min.js:270)
at Ni (react-dom.production.min.js:251)
Ib # core.cljs:2564
wn.b # set.cljs:56
g._update_watching # ratom.cljs:408
yn # ratom.cljs:62
Qn # ratom.cljs:539
(anonymous) # component.cljs:271
kg # react-dom.production.min.js:188
qi # react-dom.production.min.js:187
ak # react-dom.production.min.js:270
Ni # react-dom.production.min.js:251
me # react-dom.production.min.js:251
Ag # react-dom.production.min.js:244
(anonymous) # react-dom.production.min.js:124
e.unstable_runWithPriority # scheduler.production.min.js:19
cd # react-dom.production.min.js:123
Oh # react-dom.production.min.js:124
uc # react-dom.production.min.js:123
Vc # react-dom.production.min.js:238
enqueueForceUpdate # react-dom.production.min.js:135
r.forceUpdate # react.production.min.js:13
g.flush_render # batching.cljs:39
g.flush_queues # batching.cljs:98
g.run_queues # batching.cljs:78
a # batching.cljs:59
requestAnimationFrame (async)
g.schedule # batching.cljs:59
mn # batching.cljs:52
g.queue_render # batching.cljs:64
pn # batching.cljs:112
Qn.d.ob.d.Ja # ratom.cljs:544
g._handle_change # ratom.cljs:402
Hc # ratom.cljs:345
Cn # ratom.cljs:104
g.ua # ratom.cljs:146
Qc # core.cljs:864
qf # core.cljs:4493
(anonymous) # lobby.cljs:53
fa # react-dom.production.min.js:53
ma # react-dom.production.min.js:53
wa # react-dom.production.min.js:54
nh # react-dom.production.min.js:101
ih # react-dom.production.min.js:102
(anonymous) # react-dom.production.min.js:114
$g # react-dom.production.min.js:293
eb # react-dom.production.min.js:51
eh # react-dom.production.min.js:106
yb # react-dom.production.min.js:76
ub # react-dom.production.min.js:75
e.unstable_runWithPriority # scheduler.production.min.js:19
cd # react-dom.production.min.js:123
rb # react-dom.production.min.js:293
Fb # react-dom.production.min.js:74
Interestingly these particular errors go away when I turn on pseudo-names.
Does anyone have any idea what's going on here?
The easiest way to fix this is setting :compiler-options {:output-feature-set :es6}. $jscomp.inherits are the polyfills inserted by the Closure Compiler for transpiling class and other more "modern" constructs. Setting :es6 will stop that from happening. This is the best option unless you need to care about ancient browser versions.
Thanks for setting up a reproducible example. I can reproduce it with :simple, setting it to :advanced however works just fine? I have a rough idea what is happening in :simple and will see how to fix it properly.

autodesk forge viewer.js update from 6.5.1 to 6.6 or 7.1, 2d hyperlink promise exception

change view from 3d to 2d view.
In 6.5.1
viewer.load(document.getViewablePath(Views2D));
no exception
In 6.6
viewer.load(document.getViewablePath(Views2D));
//promise exception in chrome console
In 7.1
viewer.loadModel(document.getViewablePath(Views2D), {});
//promise exception in chrome console
Uncaught (in promise)
{instanceTree: null, maxTreeDepth: 0, err: undefined}
Promise.then (async)
loadHyperlinks # HyperlinkTool.js:323
activate # HyperlinkTool.js:123
activateTool # ToolController.js:265
f.load # Hyperlink.js:42
loadExtensionLocal # ExtensionManager.js:270
loadExtension # ExtensionManager.js:213
(anonymous) # ExtensionManager.js:312
o.onload # globals.js:183
load (async)
u # globals.js:185
(anonymous) # ExtensionManager.js:310
loadExtensionAsync # ExtensionManager.js:309
loadExtension # ExtensionManager.js:205
(anonymous) # GuiViewer3D.js:412
setTimeout (async)
D.createUI # GuiViewer3D.js:406
(anonymous) # GuiViewer3D.js:300
(anonymous) # GuiViewer3D.js:288
setTimeout (async)
(anonymous) # GuiViewer3D.js:316
(anonymous) # Viewer3D.js:1228
(anonymous) # F2DLoader.js:420
Engineering is still taking time to address this issue.
While we wait for their fix we can work around this issue by disabling the hyperlink extension in our load options:
new Autodesk.Viewing.Private.GuiViewer3D(...),{disabledExtensions:{hyperlink:true}}

ERROR TypeError: Cannot read property 'name' of undefined rest service

When I call a rest service to get the data, they don't arrive.
The output of the rest service is like this
[
{
"idpizza": 1,
"name": "jdjd",
"price": 3
},
{
"idpizza": 2,
"name": "sdfv",
"price": 2
}
]
I've already tried the same program with a list of pizzas written by me and it works, so I think I'm wrong about using the service.
service
import { Injectable } from '#angular/core';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders } from '#angular/common/http';
import { Pizza } from '../model/Pizza';
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json'
})
}
#Injectable({
providedIn: 'root'
})
export class PizzaService {
pizzasUrl:string = 'http://localhost:8080/PizzeriaServer/webapi/myresource';
pizzasLimit = '?_limit=5';
constructor(private http:HttpClient) { }
// Get Pizzas
getPizzas():Observable<Pizza[]> {
return this.http.get<Pizza[]>(`${this.pizzasUrl}${this.pizzasLimit}`);
}
}
app.component.html
<strike>
<div>
<app-header></app-header>
<app-pizza-item></app-pizza-item>
</strike>
PizzaItem.component
import { Component, OnInit, Input, EventEmitter, Output } from '#angular/core';
import { PizzaService } from '../../services/pizza.service';
import { Pizza } from 'src/app/model/Pizza';
#Component({
selector: 'app-pizza-item',
templateUrl: './pizza-item.component.html',
styleUrls: ['./pizza-item.component.css']
})
export class PizzaItemComponent implements OnInit {
#Input() pizza: Pizza;
constructor(private pizzaService:PizzaService) { }
ngOnInit() {
}
// Set Dynamic Classes
setClasses() {
}
}
<strike>
pizza-item.component.html
<div [ngClass]="setClasses()">
<p>
<label>
{{ pizza.name }}
</label>
<button class="del">X</button>
</p>
</div>
</strike>
PizzasComponent
import { Component, OnInit } from '#angular/core';
import { PizzaService } from '../../services/pizza.service';
import { Pizza } from '../../model/Pizza';
#Component({
selector: 'app-pizzas',
templateUrl: './pizzas.component.html',
styleUrls: ['./pizzas.component.css']
})
export class PizzasComponent implements OnInit {
pizzas:Pizza[];
constructor(private pizzaService:PizzaService) {
}
ngOnInit() {
this.pizzaService.getPizzas().subscribe(pizzas => {
this.pizzas = pizzas;
});
}
}
<strike>
pizzas.component.html
<app-pizza-item
*ngFor="let pizza of pizzas"
[pizza]="pizza"
>
{{console.log(pizzas)}}
</app-pizza-item>
</strike>
// model
export class Pizza {
idpizza:number;
name:string;
price:number;
}
Error:
ERROR TypeError: Cannot read property 'name' of undefined
at Object.eval [as updateRenderer] (PizzaItemComponent.html:3)
at Object.debugUpdateRenderer [as updateRenderer] (core.js:36090)
at checkAndUpdateView (core.js:35073)
at callViewAction (core.js:35433)
at execComponentViewsAction (core.js:35361)
at checkAndUpdateView (core.js:35074)
at callViewAction (core.js:35433)
at execComponentViewsAction (core.js:35361)
at checkAndUpdateView (core.js:35074)
at callWithDebugContext (core.js:36407)
View_PizzaItemComponent_0 # PizzaItemComponent.html:3
proxyClass # compiler.js:19257
logError # core.js:36342
handleError # core.js:7239
(anonymous) # core.js:32092
invoke # zone-evergreen.js:359
run # zone-evergreen.js:124
runOutsideAngular # core.js:30830
tick # core.js:32089
_loadComponent # core.js:32130
bootstrap # core.js:32053
(anonymous) # core.js:31675
_moduleDoBootstrap # core.js:31671
(anonymous) # core.js:31626
invoke # zone-evergreen.js:359
onInvoke # core.js:30904
invoke # zone-evergreen.js:358
run # zone-evergreen.js:124
(anonymous) # zone-evergreen.js:855
invokeTask # zone-evergreen.js:391
onInvokeTask # core.js:30885
invokeTask # zone-evergreen.js:390
runTask # zone-evergreen.js:168
drainMicroTaskQueue # zone-evergreen.js:559
Promise.then (async)
scheduleMicroTask # zone-evergreen.js:542
scheduleTask # zone-evergreen.js:381
scheduleTask # zone-evergreen.js:211
scheduleMicroTask # zone-evergreen.js:231
scheduleResolveOrReject # zone-evergreen.js:845
then # zone-evergreen.js:955
bootstrapModule # core.js:31656
./src/main.ts # main.ts:11
__webpack_require__ # bootstrap:78
0 # main.ts:12
__webpack_require__ # bootstrap:78
checkDeferredModules # bootstrap:45
webpackJsonpCallback # bootstrap:32
(anonymous) # main.js:1
PizzaItemComponent.html:3 ERROR CONTEXT DebugContext_ {view: {…}, nodeIndex: 5, nodeDef: {…}, elDef: {…}, elView: {…}}elDef: {nodeIndex: 4, parent: {…}, renderParent: {…}, bindingIndex: 1, outputIndex: 0, …}elView: {def: {…}, parent: {…}, viewContainerParent: null, parentNodeDef: {…}, context: PizzaItemComponent, …}nodeDef: {nodeIndex: 5, parent: {…}, renderParent: {…}, bindingIndex: 1, outputIndex: 0, …}nodeIndex: 5view: {def: {…}, parent: {…}, viewContainerParent: null, parentNodeDef: {…}, context: PizzaItemComponent, …}component: (...)componentRenderElement: (...)context: (...)elOrCompView: (...)injector: (...)providerTokens: (...)references: (...)renderNode: (...)__proto__: Object
View_PizzaItemComponent_0 # PizzaItemComponent.html:3
proxyClass # compiler.js:19257
logError # core.js:36342
handleError # core.js:7244
(anonymous) # core.js:32092
invoke # zone-evergreen.js:359
run # zone-evergreen.js:124
runOutsideAngular # core.js:30830
tick # core.js:32089
_loadComponent # core.js:32130
bootstrap # core.js:32053
(anonymous) # core.js:31675
_moduleDoBootstrap # core.js:31671
(anonymous) # core.js:31626
invoke # zone-evergreen.js:359
onInvoke # core.js:30904
invoke # zone-evergreen.js:358
run # zone-evergreen.js:124
(anonymous) # zone-evergreen.js:855
invokeTask # zone-evergreen.js:391
onInvokeTask # core.js:30885
invokeTask # zone-evergreen.js:390
runTask # zone-evergreen.js:168
drainMicroTaskQueue # zone-evergreen.js:559
Promise.then (async)
scheduleMicroTask # zone-evergreen.js:542
scheduleTask # zone-evergreen.js:381
scheduleTask # zone-evergreen.js:211
scheduleMicroTask # zone-evergreen.js:231
scheduleResolveOrReject # zone-evergreen.js:845
then # zone-evergreen.js:955
bootstrapModule # core.js:31656
./src/main.ts # main.ts:11
__webpack_require__ # bootstrap:78
0 # main.ts:12
__webpack_require__ # bootstrap:78
checkDeferredModules # bootstrap:45
webpackJsonpCallback # bootstrap:32
(anonymous) # main.js:1
core.js:30242 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
PizzaItemComponent.html:3 ERROR TypeError: Cannot read property 'name' of undefined
at Object.eval [as updateRenderer] (PizzaItemComponent.html:3)
at Object.debugUpdateRenderer [as updateRenderer] (core.js:36090)
at checkAndUpdateView (core.js:35073)
at callViewAction (core.js:35433)
at execComponentViewsAction (core.js:35361)
at checkAndUpdateView (core.js:35074)
at callViewAction (core.js:35433)
at execComponentViewsAction (core.js:35361)
at checkAndUpdateView (core.js:35074)
at callWithDebugContext (core.js:36407)
View_PizzaItemComponent_0 # PizzaItemComponent.html:3
proxyClass # compiler.js:19257
logError # core.js:36342
handleError # core.js:7239
(anonymous) # core.js:32092
invoke # zone-evergreen.js:359
run # zone-evergreen.js:124
runOutsideAngular # core.js:30830
tick # core.js:32089
(anonymous) # core.js:31927
invoke # zone-evergreen.js:359
onInvoke # core.js:30904
invoke # zone-evergreen.js:358
run # zone-evergreen.js:124
run # core.js:30769
next # core.js:31924
schedulerFn # core.js:27846
__tryOrUnsub # Subscriber.js:185
next # Subscriber.js:124
_next # Subscriber.js:72
next # Subscriber.js:49
next # Subject.js:39
emit # core.js:27808
checkStable # core.js:30847
onHasTask # core.js:30924
hasTask # zone-evergreen.js:411
_updateTaskCount # zone-evergreen.js:431
_updateTaskCount # zone-evergreen.js:264
runTask # zone-evergreen.js:185
drainMicroTaskQueue # zone-evergreen.js:559
Promise.then (async)
scheduleMicroTask # zone-evergreen.js:542
scheduleTask # zone-evergreen.js:381
scheduleTask # zone-evergreen.js:211
scheduleMicroTask # zone-evergreen.js:231
scheduleResolveOrReject # zone-evergreen.js:845
then # zone-evergreen.js:955
bootstrapModule # core.js:31656
./src/main.ts # main.ts:11
__webpack_require__ # bootstrap:78
0 # main.ts:12
__webpack_require__ # bootstrap:78
checkDeferredModules # bootstrap:45
webpackJsonpCallback # bootstrap:32
(anonymous) # main.js:1
PizzaItemComponent.html:3 ERROR CONTEXT DebugContext_ {view: {…}, nodeIndex: 5, nodeDef: {…}, elDef: {…}, elView: {…}}elDef: {nodeIndex: 4, parent: {…}, renderParent: {…}, bindingIndex: 1, outputIndex: 0, …}elView: {def: {…}, parent: {…}, viewContainerParent: null, parentNodeDef: {…}, context: PizzaItemComponent, …}nodeDef: {nodeIndex: 5, parent: {…}, renderParent: {…}, bindingIndex: 1, outputIndex: 0, …}nodeIndex: 5view: {def: {…}, parent: {…}, viewContainerParent: null, parentNodeDef: {…}, context: PizzaItemComponent, …}component: (...)componentRenderElement: (...)context: (...)elOrCompView: (...)injector: (...)providerTokens: (...)references: (...)renderNode: (...)__proto__: Object
View_PizzaItemComponent_0 # PizzaItemComponent.html:3
proxyClass # compiler.js:19257
logError # core.js:36342
handleError # core.js:7244
(anonymous) # core.js:32092
invoke # zone-evergreen.js:359
run # zone-evergreen.js:124
runOutsideAngular # core.js:30830
tick # core.js:32089
(anonymous) # core.js:31927
invoke # zone-evergreen.js:359
onInvoke # core.js:30904
invoke # zone-evergreen.js:358
run # zone-evergreen.js:124
run # core.js:30769
next # core.js:31924
schedulerFn # core.js:27846
__tryOrUnsub # Subscriber.js:185
next # Subscriber.js:124
_next # Subscriber.js:72
next # Subscriber.js:49
next # Subject.js:39
emit # core.js:27808
checkStable # core.js:30847
onHasTask # core.js:30924
hasTask # zone-evergreen.js:411
_updateTaskCount # zone-evergreen.js:431
_updateTaskCount # zone-evergreen.js:264
runTask # zone-evergreen.js:185
drainMicroTaskQueue # zone-evergreen.js:559
Promise.then (async)
scheduleMicroTask # zone-evergreen.js:542
scheduleTask # zone-evergreen.js:381
scheduleTask # zone-evergreen.js:211
scheduleMicroTask # zone-evergreen.js:231
scheduleResolveOrReject # zone-evergreen.js:845
then # zone-evergreen.js:955
bootstrapModule # core.js:31656
./src/main.ts # main.ts:11
__webpack_require__ # bootstrap:78
0 # main.ts:12
__webpack_require__ # bootstrap:78
checkDeferredModules # bootstrap:45
webpackJsonpCallback # bootstrap:32
(anonymous) # main.js:1
Use the template expression operator ?. (the-safe-navigation-operator----and-null-property-paths) for dynamic property binding like,
<label>
{{ pizza?.name }}
</label>

with HttpClient i get: Error: Cannot find a differ supporting object '[object Object]' of type 'object' [duplicate]

This question already has answers here:
Angular: Cannot find a differ supporting object '[object Object]'
(8 answers)
Closed 4 years ago.
I'm trying to show data through a json, I'm following this tutorial https://www.djamware.com/post/59924f9080aca768e4d2b12e/ionic-3-consuming-rest-api-using-new-angular-43-httpclient and with https://jsonplaceholder.typicode.com/users it shows the data perfectly but with this one
{
nombre: "Víctor",
Apellido: "Robles",
cedula: "18617014",
fecha_nacimiento: "23-08-1987",
profesion: "ing en informatica"
}
I get, Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
this is my providers/rest.ts
import { HttpClient } from '#angular/common/http';
import { Injectable } from '#angular/core';
/*
Generated class for the RestProvider provider.
See https://angular.io/guide/dependency-injection for more info on providers
and Angular DI.
*/
#Injectable()
export class RestProvider {
apiUrl = 'http://192.168.0.106:8000/api';
constructor(public http: HttpClient) {
console.log('Hello RestProvider Provider');
}
getUsers() {
return new Promise(resolve => {
this.http.get(this.apiUrl+'/users').subscribe(response => {
resolve(response);
}, err => {
console.log(err);
});
});
}
addUser(data) {
return new Promise((resolve, reject) => {
this.http.post(this.apiUrl+'/users', JSON.stringify(data))
.subscribe(res => {
resolve(res);
}, (err) => {
reject(err);
});
});
}
}
this is my show-posts.ts
import { Component } from '#angular/core';
import { IonicPage, NavController, NavParams, MenuController } from 'ionic-angular';
import { RestProvider } from '../../providers/rest/rest';
/**
* Generated class for the ShowPostsPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
#IonicPage()
#Component({
selector: 'page-show-posts',
templateUrl: 'show-posts.html',
})
export class ShowPostsPage {
users: any;
constructor(public navCtrl: NavController, public navParams: NavParams, public menuCtrl: MenuController,
public restProvider: RestProvider) {
// Cerrar menu cuando se ingrese a ClassesPage
this.menuCtrl.close();
this.getUsers();
}
ionViewDidLoad() {
console.log('ionViewDidLoad ShowPostsPage');
}
getUsers() {
this.restProvider.getUsers()
.then(data => {
this.users = data;
console.log(this.users);
});
}
}
and this is my show-posts.html
<!--
Generated template for the ShowPostsPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Usuarios</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list inset>
<ion-item *ngFor="let user of users">
<h2>{{user.nombre}}</h2>
<p>{{user.cedula}}</p>
<!-- <p>{{Usuarios.cedula}}</p>
<p>{{Usuarios.fecha_nacimiento}}</p>
<p>{{Usuarios.profesion}}</p> -->
</ion-item>
</ion-list>
</ion-content>
*Ignore the names, I know I am showing users, no posts, but this is just a try. I'm very new with api's, well with all of it
I get the data with console log
{nombre: "Víctor", Apellido: "Robles", cedula: "18617014", fecha_nacimiento: "23-08-1987", profesion: "ing en informatica"}Apellido: "Robles"cedula: "18617014"fecha_nacimiento: "23-08-1987"nombre: "Víctor"profesion: "ing en informatica"__proto__: Object
ShowPostsPage.html:18 ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
at NgForOf.ngOnChanges (VM1115 vendor.js:39917)
at checkAndUpdateDirectiveInline (VM1115 vendor.js:12781)
at checkAndUpdateNodeInline (VM1115 vendor.js:14309)
at checkAndUpdateNode (VM1115 vendor.js:14252)
at debugCheckAndUpdateNode (VM1115 vendor.js:15145)
at debugCheckDirectivesFn (VM1115 vendor.js:15086)
at Object.eval [as updateDirectives] (VM1224 ShowPostsPage.ngfactory.js:58)
at Object.debugUpdateDirectives [as updateDirectives] (VM1115 vendor.js:15071)
at checkAndUpdateView (VM1115 vendor.js:14218)
at callViewAction (VM1115 vendor.js:14569)
View_ShowPostsPage_0 # ShowPostsPage.html:18
proxyClass # compiler.js:14659
DebugContext_.logError # core.js:15038
ErrorHandler.handleError # core.js:1510
IonicErrorHandler.handleError # ionic-error-handler.js:61
(anonymous) # core.js:5925
t.invoke # polyfills.js:3
r.run # polyfills.js:3
NgZone.runOutsideAngular # core.js:4708
ApplicationRef.tick # core.js:5925
(anonymous) # core.js:5751
t.invoke # polyfills.js:3
onInvoke # core.js:4760
t.invoke # polyfills.js:3
r.run # polyfills.js:3
NgZone.run # core.js:4577
next # core.js:5751
schedulerFn # core.js:4342
SafeSubscriber.__tryOrUnsub # Subscriber.js:242
SafeSubscriber.next # Subscriber.js:189
Subscriber._next # Subscriber.js:129
Subscriber.next # Subscriber.js:93
Subject.next # Subject.js:55
EventEmitter.emit # core.js:4322
checkStable # core.js:4725
onHasTask # core.js:4773
t.hasTask # polyfills.js:3
t._updateTaskCount # polyfills.js:3
r._updateTaskCount # polyfills.js:3
r.runTask # polyfills.js:3
o # polyfills.js:3
e.invokeTask # polyfills.js:3
p # polyfills.js:2
v # polyfills.js:2
error (async)
O # polyfills.js:2
t.scheduleTask # polyfills.js:3
onScheduleTask # polyfills.js:3
t.scheduleTask # polyfills.js:3
r.scheduleTask # polyfills.js:3
r.scheduleEventTask # polyfills.js:3
(anonymous) # polyfills.js:2
(anonymous) # http.js:2353
Observable._trySubscribe # Observable.js:172
Observable.subscribe # Observable.js:160
subscribeToResult # subscribeToResult.js:23
MergeMapSubscriber._innerSub # mergeMap.js:132
MergeMapSubscriber._tryNext # mergeMap.js:129
MergeMapSubscriber._next # mergeMap.js:112
Subscriber.next # Subscriber.js:93
ScalarObservable._subscribe # ScalarObservable.js:49
Observable._trySubscribe # Observable.js:172
Observable.subscribe # Observable.js:160
MergeMapOperator.call # mergeMap.js:87
Observable.subscribe # Observable.js:157
FilterOperator.call # filter.js:60
Observable.subscribe # Observable.js:157
MapOperator.call # map.js:56
Observable.subscribe # Observable.js:157
(anonymous) # rest.ts:23
t # polyfills.js:3
webpackJsonp.165.RestProvider.getUsers # rest.ts:22
webpackJsonp.108.ShowPostsPage.getUsers # show-posts.ts:51
ShowPostsPage # show-posts.ts:43
createClass # core.js:12491
createDirectiveInstance # core.js:12326
createViewNodes # core.js:13784
createRootView # core.js:13673
callWithDebugContext # core.js:15098
debugCreateRootView # core.js:14381
ComponentFactory_.create # core.js:11278
ComponentFactoryBoundToModule.create # core.js:4030
NavControllerBase._viewInit # nav-controller-base.js:441
(anonymous) # nav-controller-base.js:254
t.invoke # polyfills.js:3
onInvoke # core.js:4760
t.invoke # polyfills.js:3
r.run # polyfills.js:3
(anonymous) # polyfills.js:3
t.invokeTask # polyfills.js:3
onInvokeTask # core.js:4751
t.invokeTask # polyfills.js:3
r.runTask # polyfills.js:3
o # polyfills.js:3
e.invokeTask # polyfills.js:3
p # polyfills.js:2
v # polyfills.js:2
ShowPostsPage.html:18 ERROR CONTEXT DebugContext_ {view: {…}, nodeIndex: 20, nodeDef: {…}, elDef: {…}, elView: {…}}
From your logs, looks like the data coming through is just a single user (victor robles). that is the main issue.
However, I would suggest declaring your users property as any[] instead of just any. and then wrap your single user, i.e. data with [] if you want to work around it.
this.users = [data];
Then again, you are not getting a list of users from your service. It should be a collection (an array) if it were a list of users, not a single object.

Angular2: Very strange behaviour, error complaining about a component that's not imported even though it is imported in app.module

I am busy with an Angular2 app and experiencing something very strange... I created a new component using angular-cli called GoodsReceivedComponent. when I import the component into my app.module.ts and app.routing.ts I don't get any build errors but when I add the path to GoodsReceived in my app.routing.ts I get an error saying GoodsReceivedComponent isn't part of any module but it is imported into my app.module... Any idea what might be going wrong here?
my code:
goods-received.component.ts:
export class GoodsReceivedComponent implements OnInit {
in app.module.ts:
import { GoodsReceivedComponent } from './Components/goods-received/goods-received.component';
declarations: [
AppComponent,
ProductComponent,
CheckBarcodesComponent,
HomeComponent,
NavigationComponent,
SettingsComponent,
StockTransactionItemComponent,
StockTakeComponent,
spinners.CircleComponent,
LoaderComponent,
ErrorComponent,
GoodsReceivedComponent
],
in app.routing.ts:
import { GoodsReceivedComponent } from './components/goods-received/goods-received.component';
const appRoutes : Routes = [
{path: "settings", component: SettingsComponent },
{path: "checkBarcodes", component: CheckBarcodesComponent },
{path: "home", component: HomeComponent},
{path: "", redirectTo: 'home', pathMatch: 'full'},
{path: "stockTake", component: StockTakeComponent}
{path: "goodsReceived", component: GoodsReceivedComponent}
];
my error:
runtime_compiler.js:215Uncaught Error: Component GoodsReceivedComponent is not part of any NgModule or the module has not been imported into your module.
at RuntimeCompiler._createCompiledHostTemplate (http://localhost:4200/main.bundle.js:38664:19)
at http://localhost:4200/main.bundle.js:38623:37
at Array.forEach (native)
at http://localhost:4200/main.bundle.js:38621:45
at Array.forEach (native)
at RuntimeCompiler._compileComponents (http://localhost:4200/main.bundle.js:38612:43)
at RuntimeCompiler._compileModuleAndComponents (http://localhost:4200/main.bundle.js:38539:37)
at RuntimeCompiler.compileModuleAsync (http://localhost:4200/main.bundle.js:38530:21)
at PlatformRef_._bootstrapModuleWithZone (http://localhost:4200/main.bundle.js:27267:25)
at PlatformRef_.bootstrapModule (http://localhost:4200/main.bundle.js:27249:21)
RuntimeCompiler._createCompiledHostTemplate # runtime_compiler.js:215
(anonymous) # runtime_compiler.js:174
(anonymous) # runtime_compiler.js:172
RuntimeCompiler._compileComponents # runtime_compiler.js:163
RuntimeCompiler._compileModuleAndComponents # runtime_compiler.js:90
RuntimeCompiler.compileModuleAsync # runtime_compiler.js:81
PlatformRef_._bootstrapModuleWithZone # application_ref.js:328
PlatformRef_.bootstrapModule # application_ref.js:310
(anonymous) # main.ts:12
__webpack_require__ # bootstrap 1f81207…:52
(anonymous) # zone.js:1428
__webpack_require__ # bootstrap 1f81207…:52
webpackJsonpCallback # bootstrap 1f81207…:23
(anonymous) # main.bundle.js:1
client:38 [WDS] Errors while compiling.
client:80 [default] C:\Users\Deon\Documents\trade-link\barcode-checker\src\app\app.routing.ts:16:1
',' expected.
errors # client:80
sock.onmessage # socket.js:37
EventTarget.dispatchEvent # eventtarget.js:51
(anonymous) # main.js:274
SockJS._transportMessage # main.js:272
EventEmitter.emit # emitter.js:50
WebSocketTransport.ws.onmessage # websocket.js:35
wrapFn # zone.js:698
ZoneDelegate.invokeTask # zone.js:265
Zone.runTask # zone.js:154
ZoneTask.invoke # zone.js:335
In the app.module.ts file there is a typo in the import statement
This line:
import { GoodsReceivedComponent } from './Components/goods-received/goods-received.component';
should be:
import { GoodsReceivedComponent } from './components/goods-received/goods-received.component';
Note the './Components' after 'from' should be './components'