I am having problems with angular -router-loader,
Where I want the lazyload module, and I follow every tutorial I have seen
and I keep getting this error TypeError: Cannot convert undefined or null to object::

Here is my webpack.config.common.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
'app': './app/main.ts'
},
resolve: {
extensions: ['.js', '.ts']
},
module: {
loaders: [
{
test: /\.ts$/,
loaders: [
'awesome-typescript-loader',
'angular2-template-loader',
'angular-router-loader'
]
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/,
loader: 'raw-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.html'
}),
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
'./app' // location of the src
)
]
};
And so app.routing.ts
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const appRoutes: Routes = [
{
path: '',
redirectTo: '/dashboard',
pathMatch: 'full'
},
{
path: 'dashboard',
loadChildren: './dashboard/dashboard.module#DashboardModule'
}
];
export const appRoutingProviders: any[] = [
];
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
Here dashboard/dashboard.module:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { DashboardComponent } from './dashboard.component';
import { dashboardRouting } from './dashboard.routing';
@NgModule({
imports: [
CommonModule,
FormsModule,
dashboardRouting
],
declarations: [
DashboardComponent
],
providers: [
]
})
export class DashboardModule {}
Here are my dependencies:
"devDependencies": {
"@types/core-js": "^0.9.35",
"@types/hammerjs": "^2.0.34",
"@types/jasmine": "^2.5.38",
"@types/node": "^6.0.53",
"angular-router-loader": "^0.5.0",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^3.0.0-beta.18",
"del-cli": "^0.2.1",
"html-loader": "^0.4.4",
"html-webpack-plugin": "^2.26.0",
"lite-server": "^2.2.2",
"raw-loader": "^0.5.1",
"webpack": "^2.2.0-rc.4",
"webpack-dev-server": "^2.2.0-rc.0",
"webpack-merge": "^2.4.0"
}
What did i do wrong?