im tring to test the app with jasmine, and when the compilation is done i get this message:
Chrome 67.0.3396 (Windows 10 0.0.0) ERROR
{
"message": "Uncaught ReferenceError: exports is not defined\nat app/app-routing.module.js:2:23\n\nReferenceError: exports is not defined\n at app/app-routing.module.js:2:23",
"str": "Uncaught ReferenceError: exports is not defined\nat app/app-routing.module.js:2:23\n\nReferenceError: exports is not defined\n at app/app-routing.module.js:2:23"
}
i tried to add export = 0 on the top of the file but i get another error: An export assignment cannot be used in a module with other exported elements.
app-routing.module.ts:
import { NgModule } from "@angular/core";
import { Routes } from "@angular/router";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { LoggedInLazyLoadGuard } from "./logged-in-lazy-load.guard";
const routes: Routes = [
{ path: "", redirectTo: "/home", pathMatch: "full" },
{ path: "login", loadChildren: "./login/login.module#LoginModule" },
{ path: "home", loadChildren: "./home/home.module#HomeModule", canLoad: [LoggedInLazyLoadGuard] }
];
@NgModule({
imports: [NativeScriptRouterModule.forRoot(routes)],
exports: [NativeScriptRouterModule]
})
export class AppRoutingModule { }
tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"lib": [
"es6",
"dom",
"es2015.iterable"
],
"baseUrl": ".",
"paths": {
"~/*": [
"app/*"
],
"*": [
"./node_modules/tns-core-modules/*",
"./node_modules/*"
]
}
},
"exclude": [
"node_modules",
"platforms"
]
}
versions
tns: 4.1.0
npm: 6.1.0
node: 8.11.2

Aucun commentaire:
Enregistrer un commentaire