TypeError: Cannot read property 'getGlobalEventTarget' of null - node.js

I was upgrading my project angular version from 4.4.7 to latest. I updated my node.js to the latest( 8.11.1 ) and also angular cli to the latest( 1.7.4 ). Now when I am running my code with npm start here is the full error.
core.es5.js:1020 ERROR Error: Uncaught (in promise): TypeError:
Cannot read property 'getGlobalEventTarget' of null
TypeError: Cannot read property 'getGlobalEventTarget' of null
at DomEventsPlugin.EventManagerPlugin.addGlobalEventListener
(platform-browser.es5.js:2474)
at EventManager.addGlobalEventListener (platform-browser.es5.js:2405)
at DefaultDomRenderer2.listen (platform-browser.es5.js:2912)
at BaseAnimationRenderer.listen (animations.es5.js:491)
at listenToElementOutputs (core.es5.js:9215)
at createViewNodes (core.es5.js:12159)
at createRootView (core.es5.js:12082)
at Object.createProdRootView [as createRootView] (core.es5.js:12756)
at ComponentFactory_.create (core.es5.js:9861)
at ComponentFactoryBoundToModule.create (core.es5.js:3333)
at DomEventsPlugin.EventManagerPlugin.addGlobalEventListener (platform-browser.es5.js:2474)
at EventManager.addGlobalEventListener (platform-browser.es5.js:2405)
at DefaultDomRenderer2.listen (platform-browser.es5.js:2912)
at BaseAnimationRenderer.listen (animations.es5.js:491)
at listenToElementOutputs (core.es5.js:9215)
at createViewNodes (core.es5.js:12159)
at createRootView (core.es5.js:12082)
at Object.createProdRootView [as createRootView] (core.es5.js:12756)
at ComponentFactory_.create (core.es5.js:9861)
at ComponentFactoryBoundToModule.create (core.es5.js:3333)
at resolvePromise (zone.js:814)
at resolvePromise (zone.js:771)
at zone.js:873
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.es5.js:3881)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at drainMicroTaskQueue (zone.js:595)
at ZoneTask.invokeTask [as invoke] (zone.js:500)
at invokeTask (zone.js:1540)

Please remove the angular BrowserModule, BrowserAnimationsModule/NoopAnimationsModule import from the child module.
And include these imports in the Parent Module and you are good to go.
//import { BrowserModule } from '#angular/platform-browser';
//import { BrowserAnimationsModule, NoopAnimationsModule } from '#angular/platform-browser/animations';
#NgModule({
declarations: [..],
imports: [
CommonModule,
//BrowserModule,
//BrowserAnimationsModule,
//NoopAnimationsModule,
],
providers: [],
})
export class ChildModule { }

Related

NativeScript Error NG8001: 'ActionBar' is not a known element

My startupscreen.module.ts looks like this:
import { NativeScriptFormsModule } from "#nativescript/angular";
import { NativeScriptCommonModule } from "#nativescript/angular/common";
import { NgModule, NO_ERRORS_SCHEMA } from "#angular/core";
import { StartupscreenComponent } from "./startupscreen.component";
#NgModule({
imports: [
NativeScriptFormsModule,
NativeScriptCommonModule
],
declarations: [
StartupscreenComponent
],
schemas: [
NO_ERRORS_SCHEMA
],
})
export class StartupscreenModule { }
My app.module.ts looks like this:
import { NgModule, NO_ERRORS_SCHEMA } from "#angular/core";
import { NativeScriptFormsModule, NativeScriptModule } from "#nativescript/angular";
import { FormsModule} from '#angular/forms'
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { BrowserModule } from '#angular/platform-browser';
import { StartupscreenModule } from "./startupscreen/startupscreen.module";
#NgModule({
bootstrap: [
AppComponent
],
imports: [
FormsModule,
BrowserModule,
NativeScriptModule,
NativeScriptFormsModule,
AppRoutingModule,
NativeScriptFormsModule,
StartupscreenModule,
],
declarations: [
AppComponent
],
schemas: [
NO_ERRORS_SCHEMA
]
})
export class AppModule { }
And i always get that error whencompiling.
Everything should be running.
My Path looks like this:
Full Error:
ERROR in ./app/startupscreen/startupscreen.module.ts
Module not found: Error: Can't resolve '#nativescript/angular/common' in 'E:\Users\SwaX\Desktop\MorseChat\src\app\startupscreen'
# ./app/startupscreen/startupscreen.module.ts 2:0-72 11:12-36 14:8-32 20:20-44
# ./app/app.module.ts
# ./main.ts
Error from chokidar (E:\): Error: EBUSY: resource busy or locked, lstat 'E:\swapfile.sys'
(node:11364) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat 'E:\Users\Default User'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
(node:11364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
And after i remove the Startupscreen in the app.module.ts it says that it cannot find .
startupscreen.component.html:
<ActionBar title="Startupscreen">
<NavigationButton (tap)="onBackTap()" android.systemIcon="ic_menu_back"></NavigationButton>
</ActionBar>
<StackLayout class="page">
<StackLayout class="box box-1">
<Label textWrap="true" text="Bitte hier klicken wenn Sie sehen können."></Label>
</StackLayout>
<StackLayout class="box box-2">
<Label textWrap="true" text="Bitte hier klicken wenn Sie Taubblind sind."></Label>
</StackLayout>
</StackLayout>
I believe that the path for NativescriptCommonModule is just #nativescript/angular similar to NativeScriptFormsModule
import { NativeScriptCommonModule } from "#nativescript/angular";

Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a #NgModule annotation

I do not understand why I am getting this error:
Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a #NgModule annotation.
I have tried both:
import { HttpClient } from '#angular/common/http';
and
import { HttpClientModule } from '#angular/common/http';
This is the full error:
Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a #NgModule annotation.
at syntaxError (http://localhost:8100/build/vendor.js:116430:34)
at http://localhost:8100/build/vendor.js:131184:44
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/vendor.js:131159:49)
at JitCompiler._loadModules (http://localhost:8100/build/vendor.js:150357:87)
at JitCompiler._compileModuleAndComponents (http://localhost:8100/build/vendor.js:150318:36)
at JitCompiler.compileModuleAsync (http://localhost:8100/build/vendor.js:150212:37)
at CompilerImpl.compileModuleAsync (http://localhost:8100/build/vendor.js:115251:49)
at PlatformRef.bootstrapModule (http://localhost:8100/build/vendor.js:5952:25)
at Object.491 (http://localhost:8100/build/main.js:2405:109)
Ionic Framework: 3.9.2
Ionic Native: ^2.9.0
Ionic App Scripts: 3.2.4
Angular Core: 5.2.11
Angular Compiler CLI: 5.2.11
Node: 8.10.0
OS: Windows 10
You need import HttpClientModule, example:
import { HttpClientModule } from '#angular/common/http';
#NgModule({
imports: [
BrowserModule,
// import HttpClientModule after BrowserModule.
HttpClientModule,
],
declarations: [
AppComponent,
],
bootstrap: [ AppComponent ]
})
export class AppModule {}
Read: Angula HttpClient

Starting vue js dev server gives eror: .plugins[0] may only be a two-tuple or three-tuple

I am using Vue CLI version 3 to run a Vue application inside a Docker container. To start the development server, I run:
https://cli.vuejs.org/guide/cli-service.html
This gives the following error:
ERROR Failed to compile with 1 errors 17:05:14
error in ./app/main.js
Module build failed (from ./node_modules/#vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js):
Error: .plugins[0] may only be a two-tuple or three-tuple
at assertPluginItem (/home/src/node_modules/#babel/core/lib/config/validation/option-assertions.js:235:13)
at arr.forEach (/home/src/node_modules/#babel/core/lib/config/validation/option-assertions.js:222:30)
at Array.forEach (<anonymous>)
at assertPluginList (/home/src/node_modules/#babel/core/lib/config/validation/option-assertions.js:222:9)
at Object.keys.forEach.key (/home/src/node_modules/#babel/core/lib/config/validation/options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (/home/src/node_modules/#babel/core/lib/config/validation/options.js:83:21)
at validate (/home/src/node_modules/#babel/core/lib/config/validation/options.js:74:10)
at file (/home/src/node_modules/#babel/core/lib/config/config-chain.js:174:34)
at cachedFunction (/home/src/node_modules/#babel/core/lib/config/caching.js:33:19)
at buildRootChain (/home/src/node_modules/#babel/core/lib/config/config-chain.js:120:36)
at loadPrivatePartialConfig (/home/src/node_modules/#babel/core/lib/config/partial.js:85:55)
at Object.loadPartialConfig (/home/src/node_modules/#babel/core/lib/config/partial.js:110:18)
at Object.<anonymous> (/home/src/node_modules/#vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:140:26)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/src/node_modules/#vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:3:103)
# multi (webpack)-dev-server/client/index.js ./node_modules/#vue/cli-service/node_modules/webpack/hot/dev-server.js ./app/main.js
I suspect that the offending code is the following, in my .babelrc file:
"plugins": [
["transform-runtime", "transform-vue-jsx", "transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
Could someone suggest how I could go about resolving this? Thanks!
Your [ is in the wrong place. It should be
"plugins": [
"transform-runtime",
"transform-vue-jsx",
["transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
]

Using nbind with Angular 5 and TypeScript

I am trying to use nbind to easily create a C++ NodeJS module in an Angular website. I created a new Angular CLI project in Webstorm and followed the tutorial at https://github.com/charto/nbind. Everything builds and my lib-types.d.t file is being generated:
import { Buffer } from "nbind/dist/shim";
export class NBindBase { free?(): void }
export class Greeter extends NBindBase {
/** static void sayHello(std::string); */
static sayHello(p0: string): void;
}
I import the library in my AppComponent like this:
import { Component } from '#angular/core';
import * as nbind from 'nbind';
import * as LibTypes from './../lib-types';
#Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
sayHello() {
const lib = nbind.init<typeof LibTypes>().lib;
lib.Greeter.sayHello('aaaaaaaaaaaaaah');
}
}
I added a button with (click)=>"sayHello()" which should call the library. When running the application I get multiple warnings (the request of a dependency is an expression):
WARNING in ./node_modules/nbind/dist/nbind.js
128:4-32 Critical dependency: the request of a dependency is an expression
at CommonJsRequireContextDependency.getWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18)
at Compilation.reportDependencyErrorsAndWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:703:24)
at Compilation.finish (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:561:9)
at applyPluginsParallel.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compiler.js:502:17)
at E:\Projects\streaming\asdf\streampp\node_modules\tapable\lib\Tapable.js:289:11
at _addModuleChain (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:507:11)
at processModuleDependencies.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:477:14)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
# ./node_modules/nbind/dist/nbind.js
# ./src/app/app.component.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
WARNING in ./node_modules/nbind/dist/nbind.js
141:14-42 Critical dependency: the request of a dependency is an expression
at CommonJsRequireContextDependency.getWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18)
at Compilation.reportDependencyErrorsAndWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:703:24)
at Compilation.finish (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:561:9)
at applyPluginsParallel.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compiler.js:502:17)
at E:\Projects\streaming\asdf\streampp\node_modules\tapable\lib\Tapable.js:289:11
at _addModuleChain (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:507:11)
at processModuleDependencies.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:477:14)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
# ./node_modules/nbind/dist/nbind.js
# ./src/app/app.component.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
WARNING in ./node_modules/nbind/dist/nbind.js
53:28-53 Critical dependency: the request of a dependency is an expression
at RequireResolveContextDependency.getWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18)
at Compilation.reportDependencyErrorsAndWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:703:24)
at Compilation.finish (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:561:9)
at applyPluginsParallel.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compiler.js:502:17)
at E:\Projects\streaming\asdf\streampp\node_modules\tapable\lib\Tapable.js:289:11
at _addModuleChain (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:507:11)
at processModuleDependencies.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:477:14)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
# ./node_modules/nbind/dist/nbind.js
# ./src/app/app.component.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
WARNING in ./node_modules/nbind/dist/nbind.js
72:28-57 Critical dependency: the request of a dependency is an expression
at RequireResolveContextDependency.getWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18)
at Compilation.reportDependencyErrorsAndWarnings (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:703:24)
at Compilation.finish (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:561:9)
at applyPluginsParallel.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compiler.js:502:17)
at E:\Projects\streaming\asdf\streampp\node_modules\tapable\lib\Tapable.js:289:11
at _addModuleChain (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:507:11)
at processModuleDependencies.err (E:\Projects\streaming\asdf\streampp\node_modules\webpack\lib\Compilation.js:477:14)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
# ./node_modules/nbind/dist/nbind.js
# ./src/app/app.component.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
Also when I click the button I get the following error:
ERROR TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (index.js:71)
at findCompiledModule (nbind.js:70)
at find (nbind.js:93)
at Object.init (nbind.js:104)
at AppComponent.sayHello (app.component.ts:14)
at Object.eval [as handleEvent] (AppComponent.html:1)
at handleEvent (core.js:13530)
at callWithDebugContext (core.js:15039)
at Object.debugHandleEvent [as handleEvent] (core.js:14626)
at dispatchEvent (core.js:9945)
Is this a bug in nbind, or am I importing my library in the wrong way?
The current code can be found at https://github.com/kayvanbree/angular-nbind-boilerplate.
Angular is a front-end framework. From your angular part you can call a web service but not directly use C++ in your front-end part.
You need to configure one back-end part with nodeJS.
You can use C++ part in your NodeJS part with nbind.
(https://github.com/charto/nbind#using-nbind-headers)
After that, you can call NodeJS server from Angular part.
You try to do that :
You want to do that :
The problem is that you are importing nbind at your angular application, and nbind need the node or python to run nbind.
You should import at your node (server side) application, not at your angular (client-side application).
The answers here are not correct. If you build targeting asm.js then code compiled with nbind does not need to be running in node and can run in the browser: https://github.com/charto/nbind#using-in-web-browsers

Angular4: Node is throwing a reference error: navigator is not defined when I add <md-sidenav>

I'm using Angular 4 and angular/material. MdToolbar works fine, but when I add MdSidenav to my app template just like the documentation states Node gives me a ReferenceError: navigator is not defined. anyone experience anything similar?
src/app.component.html
<md-sidenav-container>
<layout-header>
<nav-bar></nav-bar>
<!-- TODO: Create nav component -->
<a routerLink="/">Home</a>
<a routerLink="/about">About</a>
<a routerLink="/lazy">Lazy</a>
<a routerLink="/lazy2">Lazy 2</a>
<a routerLink="/user-profile">User Profile</a>
<a routerLink="/test-rest">Test Rest</a>
<a routerLink="/test-route-params">Test Route Params</a>
</layout-header>
<md-sidenav #sidenav class="sidenav">
<ul>
<li>Search</li>
<li>Start a Group</li>
<li>App Settings</li>
<li>About</li>
<li>Help</li>
<li>Logout</li>
</ul>
</md-sidenav>
<!--primary router outlet: a dynamic component that the router uses to
display-->
<router-outlet></router-outlet>
<!-- TODO: Issue with event not emitting via onShown/onHidden -->
<!-- Ref: https://github.com/valor-software/ngx-bootstrap/issues/1886 -->
<app-dialog (dynamicComponent)="onDialogLoad($event)" (onShown)="test()"
(onHidden)="test2()"></app-dialog>
<!--TODO: example; Delete-->
<button (click)="create()">Create</button>
<simple-notifications [options]="options"></simple-notifications>
<layout-footer></layout-footer>
</md-sidenav-container>
src/app.module.ts
#NgModule({
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
TransferHttpModule,
NgReduxModule,
MdToolbarModule,
MdSidenavModule,
MdIconModule,
MdCardModule,
MdInputModule,
MdButtonModule,
DialogModule.forRoot([LoginForm]),
SimpleNotificationsModule.forRoot(), // TODO: remove; testing only
RouterModule.forRoot(AppRoutes)
],
providers: [ AuthGuard, DialogService ],
declarations: [
AppComponent,
HomeView,
AboutComponent,
HeaderComponent,
FooterComponent,
NavBarComponent,
LoginForm,
SideNavComponent
],
exports: [ AppComponent ],
bootstrap : [ AppComponent ]
})
export class AppModule {}
NodeJS error
ERROR { ReferenceError: navigator is not defined
at new Platform (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/material/bundles/material.umd.js:3396:36)
at ServerAppModuleInjector.get (ng:///ServerAppModule/module.ngfactory.js:177:61)
at ServerAppModuleInjector.get (ng:///ServerAppModule/module.ngfactory.js:182:120)
at ServerAppModuleInjector.get (ng:///ServerAppModule/module.ngfactory.js:187:108)
at ServerAppModuleInjector.getInternal (ng:///ServerAppModule/module.ngfactory.js:477:56)
at ServerAppModuleInjector.NgModuleInjector.get (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:3563:44)
at resolveDep (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:10931:45)
at createClass (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:10795:147)
at createDirectiveInstance (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:10628:37)
at createViewNodes (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:11978:49)
at callViewAction (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:12348:13)
at execComponentViewsAction (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:12287:13)
at createViewNodes (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:12005:5)
at createRootView (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:11883:5)
at Object.createProdRootView [as createRootView] (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:12461:12)
at ComponentFactory_.create (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:9819:46)
at ComponentFactoryBoundToModule.create (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:3434:29)
at ApplicationRef_.bootstrap (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:5016:57)
at /Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:4803:79
at Array.forEach (native)
at PlatformRef_._moduleDoBootstrap (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:4803:42)
at /Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:4765:27
at ZoneDelegate.invoke (/Users/lsorensen/code/OneUnionV1/node_modules/zone.js/dist/zone-node.js:365:26)
at Object.onInvoke (/Users/lsorensen/code/OneUnionV1/node_modules/#angular/core/bundles/core.umd.js:4132:37)
at ZoneDelegate.invoke (/Users/lsorensen/code/OneUnionV1/node_modules/zone.js/dist/zone-node.js:364:32)
at Zone.run (/Users/lsorensen/code/OneUnionV1/node_modules/zone.js/dist/zone-node.js:125:43)
at /Users/lsorensen/code/OneUnionV1/node_modules/zone.js/dist/zone-node.js:758:57
Just exporting MdSidenavModule from NgModule might do the trick in your case.
I had luck breaking out the Material modules(the ones used across multiple components) into their own module, which cleaned up app.module a bit. Then did an import AND export in app.module, something like this:
material.module.ts
import { MdSidenavModule } from '#angular/material';
.
.
const MATERIAL_MODULES = [
MdSidenavModule,
.
.
];
#NgModule({
imports: MATERIAL_MODULES,
exports: MATERIAL_MODULES
})
export class MaterialModule { }
app.module
import { MaterialModule } from '../material.module';
.
.
#NgModule({
imports: [
MaterialModule,
.
.
],
exports: [ MaterialModule ],
})

Resources