Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing not working with AoT #2735

Closed
Meligy opened this issue Oct 17, 2016 · 12 comments · Fixed by #2992
Closed

Routing not working with AoT #2735

Meligy opened this issue Oct 17, 2016 · 12 comments · Fixed by #2992
Labels
needs: investigation Requires some digging to determine if action is needed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@Meligy
Copy link
Contributor

Meligy commented Oct 17, 2016

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

macOS Sierra

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

Tried final beta-17 and current master

angular-cli: local (v1.0.0-beta.17, branch: master)
node: 6.7.0
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Create a new project that has routes looking like this:

app-routing:

import {SimpleRouteComponent} from './simple-route/simple-route.component';
import {BundledModule} from './bundled/bundled.module';

export function loadBundledModule() { return BundledModule; }

export const routes: Routes = [
  {
    path: '',
    pathMatch: 'full',
    component: SimpleRouteComponent
  },
  {
    path: 'bundled',
    loadChildren: loadBundledModule
  },
  {
    path: 'lazy',
    loadChildren: './lazy/lazy.module#LazyModule'
  }
];

bundled-routing:

export const routes: Routes = [
  {
    path: '',
    component: BundledComponent
  }
];

lazy-routing:

export const routes: Routes = [
  {
    path: '',
    component: LazyComponent
  }
];

Full repository sample:
https://github.com/meligy/routing-angular-cli

The log given by the failure.

Normally this include a stack trace and some more information.

First, I run ng build --aot, and it shows successful output.

Then, I run ng serve --aot, and it also shows successful output.

Loading /

But then I go to http://localhost:4200/, I see the page loading fine (the page content shows simple-route works!), but in the browser console I see this error:

chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34621 Uncaught TypeError: Cannot read property 'get' of null
    at bind (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34621:32)
    at Array.forEach (native)
    at chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34637:34
    at checkDebug (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34633:10)
    at Object.<anonymous> (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34636:2)
    at Object.<anonymous> (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34812:31)
    at __webpack_require__ (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:20:30)
    at Object.<anonymous> (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:47:19)
    at __webpack_require__ (chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:20:30)
    at chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:40:18

Synchronous Loading (Same bundle) /bundled

If I click on a router link that goes to http://localhost:4200/bundled, I get extra errors in the browser console, and the URL stays at http://localhost:4200/. Extra errors shown:

2016-10-17 13:20:59.886 error_handler.js:48 EXCEPTION: Uncaught (in promise): TypeError: r.create is not a function
ErrorHandler.handleError @ error_handler.js:48
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:20:59.886 error_handler.js:53 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ error_handler.js:53
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:20:59.886 error_handler.js:54 Error: Uncaught (in promise): TypeError: r.create is not a function
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)
ErrorHandler.handleError @ error_handler.js:54
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:20:59.887 zone.js:355 Unhandled Promise rejection: r.create is not a function ; Zone: angular ; Task: Promise.then ; Value: TypeError: r.create is not a function
    at MapSubscriber.project (router_config_loader.js:46)
    at MapSubscriber._next (map.js:77)
    at MapSubscriber.Subscriber.next (Subscriber.js:89)
    at MergeMapSubscriber.notifyNext (mergeMap.js:133)
    at InnerSubscriber._next (InnerSubscriber.js:23)
    at InnerSubscriber.Subscriber.next (Subscriber.js:89)
    at Object.subscribeToResult (subscribeToResult.js:16)
    at MergeMapSubscriber._innerSub (mergeMap.js:120)
    at MergeMapSubscriber._tryNext (mergeMap.js:117)
    at MergeMapSubscriber._next (mergeMap.js:100) TypeError: r.create is not a function
    at MapSubscriber.project (http://localhost:4200/main.bundle.js:9952:25)
    at MapSubscriber._next (http://localhost:4200/main.bundle.js:14417:35)
    at MapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:3004:18)
    at MergeMapSubscriber.notifyNext (http://localhost:4200/main.bundle.js:10204:30)
    at InnerSubscriber._next (http://localhost:4200/main.bundle.js:43255:21)
    at InnerSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:3004:18)
    at Object.subscribeToResult (http://localhost:4200/main.bundle.js:21714:25)
    at MergeMapSubscriber._innerSub (http://localhost:4200/main.bundle.js:10191:38)
    at MergeMapSubscriber._tryNext (http://localhost:4200/main.bundle.js:10188:14)
    at MergeMapSubscriber._next (http://localhost:4200/main.bundle.js:10171:18)
consoleError @ zone.js:355
_loop_1 @ zone.js:382
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:20:59.888 zone.js:357 Error: Uncaught (in promise): TypeError: r.create is not a function
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)

Lazy Loading /lazy

If I then refresh, and click on the router link that goes to http://localhost:4200/lazy, again, the URL stays at http://localhost:4200/, and I get another error:

2016-10-17 13:22:45.339 error_handler.js:48 EXCEPTION: Uncaught (in promise): Error: Cannot find module './lazy/lazy.module.ngfactory'.
ErrorHandler.handleError @ error_handler.js:48
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:22:45.340 error_handler.js:53 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ error_handler.js:53
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:22:45.340 error_handler.js:54 Error: Uncaught (in promise): Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)
ErrorHandler.handleError @ error_handler.js:54
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:22:45.340 zone.js:355 Unhandled Promise rejection: Cannot find module './lazy/lazy.module.ngfactory'. ; Zone: angular ; Task: Promise.then ; Value: Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at webpackEmptyContext (src async:2)
    at SystemJsNgModuleLoader.loadFactory (system_js_ng_module_factory_loader.js:61)
    at RouterConfigLoader.loadModuleFactory (router_config_loader.js:53)
    at RouterConfigLoader.load (router_config_loader.js:45)
    at MergeMapSubscriber.project (apply_redirects.js:246)
    at MergeMapSubscriber._tryNext (mergeMap.js:110)
    at MergeMapSubscriber._next (mergeMap.js:100)
    at MergeMapSubscriber.Subscriber.next (Subscriber.js:89)
    at ScalarObservable._subscribe (ScalarObservable.js:49)
    at ScalarObservable.Observable.subscribe (Observable.js:56) Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at webpackEmptyContext (http://localhost:4200/main.bundle.js:31955:8)
    at SystemJsNgModuleLoader.loadFactory (http://localhost:4200/main.bundle.js:25415:40)
    at RouterConfigLoader.loadModuleFactory (http://localhost:4200/main.bundle.js:9959:128)
    at RouterConfigLoader.load (http://localhost:4200/main.bundle.js:9951:81)
    at MergeMapSubscriber.project (http://localhost:4200/main.bundle.js:38688:111)
    at MergeMapSubscriber._tryNext (http://localhost:4200/main.bundle.js:10181:27)
    at MergeMapSubscriber._next (http://localhost:4200/main.bundle.js:10171:18)
    at MergeMapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:3004:18)
    at ScalarObservable._subscribe (http://localhost:4200/main.bundle.js:30856:24)
    at ScalarObservable.Observable.subscribe (http://localhost:4200/main.bundle.js:1018:27)
consoleError @ zone.js:355
_loop_1 @ zone.js:382
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
2016-10-17 13:22:45.341 zone.js:357 Error: Uncaught (in promise): Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)

Mention any other details that might be useful.

I tried commenting different pieces of the routing but always get some sort of error. Also tried upgrading all Angular packages including @angular/router, @angular/compiler, @angular/platform-server and zone.js and ts-helpers to latest with no luck getting a clean browser console output.


Thanks! We'll be in touch soon.

@Meligy
Copy link
Contributor Author

Meligy commented Oct 17, 2016

I tried to get inspiration from several other issues (#2577, #2678 (comment) etc) but no luck.

@filipesilva filipesilva added command: build P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix needs: investigation Requires some digging to determine if action is needed labels Oct 17, 2016
@filipesilva
Copy link
Contributor

If I had to bet, I'd say this is related to the loadBundledModule function, but have to investigate better.

Also, what is this chrome extension?

at chrome-extension://elgalmkoelokbchhkhacckoklkejnhcd/build/backend.js:34637:34

@Meligy
Copy link
Contributor Author

Meligy commented Oct 17, 2016

Oh. Sorry, I have tried so many things that I kinda got tired and copied the current output blindly.

The case of SimpleRouteComponent (no child routes,root / path) works just fine. The error is Augury specific.

However, the sync/bundled load case, and the lazy case are genuine issues I believe. Different ones as well.

The reason for writing the function for bundled this way is the signature of the loadChildren property:

/**
 * @whatItDoes The type of `loadChildren`.
 * See {@link Routes} for more details.
 * @stable
 */
export declare type LoadChildrenCallback = () => Type<any> | Promise<Type<any>> | Observable<Type<any>>;
/**
 * @whatItDoes The type of `loadChildren`.
 *
 * See {@link Routes} for more details.
 * @stable
 */
export declare type LoadChildren = string | LoadChildrenCallback;

Even when commenting it, I still get this error for lazy loading (I understand the Angular CLI configures Webpack for the lazy loading).

Error going /lazy

lang.js:201Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
error_handler.js:48 EXCEPTION: Uncaught (in promise): Error: Cannot find module './lazy/lazy.module.ngfactory'.
ErrorHandler.handleError @ error_handler.js:48
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
error_handler.js:53 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ error_handler.js:53
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
error_handler.js:54 Error: Uncaught (in promise): Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)
ErrorHandler.handleError @ error_handler.js:54
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
zone.js:355 Unhandled Promise rejection: Cannot find module './lazy/lazy.module.ngfactory'. ; Zone: angular ; Task: Promise.then ; Value: Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at webpackEmptyContext (src async:2)
    at SystemJsNgModuleLoader.loadFactory (system_js_ng_module_factory_loader.js:61)
    at RouterConfigLoader.loadModuleFactory (router_config_loader.js:53)
    at RouterConfigLoader.load (router_config_loader.js:45)
    at MergeMapSubscriber.project (apply_redirects.js:246)
    at MergeMapSubscriber._tryNext (mergeMap.js:110)
    at MergeMapSubscriber._next (mergeMap.js:100)
    at MergeMapSubscriber.Subscriber.next (Subscriber.js:89)
    at ScalarObservable._subscribe (ScalarObservable.js:49)
    at ScalarObservable.Observable.subscribe (Observable.js:56) Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at webpackEmptyContext (http://localhost:4200/main.bundle.js:31955:8)
    at SystemJsNgModuleLoader.loadFactory (http://localhost:4200/main.bundle.js:25415:40)
    at RouterConfigLoader.loadModuleFactory (http://localhost:4200/main.bundle.js:9959:128)
    at RouterConfigLoader.load (http://localhost:4200/main.bundle.js:9951:81)
    at MergeMapSubscriber.project (http://localhost:4200/main.bundle.js:38688:111)
    at MergeMapSubscriber._tryNext (http://localhost:4200/main.bundle.js:10181:27)
    at MergeMapSubscriber._next (http://localhost:4200/main.bundle.js:10171:18)
    at MergeMapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:3004:18)
    at ScalarObservable._subscribe (http://localhost:4200/main.bundle.js:30856:24)
    at ScalarObservable.Observable.subscribe (http://localhost:4200/main.bundle.js:1018:27)
consoleError @ zone.js:355
_loop_1 @ zone.js:382
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): Error: Cannot find module './lazy/lazy.module.ngfactory'.
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)
consoleError @ zone.js:357
_loop_1 @ zone.js:382
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308

Also, for the record:

Error on sync/same-bundle module /bundled

lang.js:201Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
error_handler.js:48 EXCEPTION: Uncaught (in promise): TypeError: r.create is not a function
ErrorHandler.handleError @ error_handler.js:48
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
error_handler.js:53 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ error_handler.js:53
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
error_handler.js:54 Error: Uncaught (in promise): TypeError: r.create is not a function
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)
ErrorHandler.handleError @ error_handler.js:54
next @ application_ref.js:298
schedulerFn @ async.js:89
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:81
NgZone.triggerError @ ng_zone.js:280
onHandleError @ ng_zone.js:259
Zone.runGuarded @ zone.js:113
_loop_1 @ zone.js:379
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
zone.js:355 Unhandled Promise rejection: r.create is not a function ; Zone: angular ; Task: Promise.then ; Value: TypeError: r.create is not a function
    at MapSubscriber.project (router_config_loader.js:46)
    at MapSubscriber._next (map.js:77)
    at MapSubscriber.Subscriber.next (Subscriber.js:89)
    at MergeMapSubscriber.notifyNext (mergeMap.js:133)
    at InnerSubscriber._next (InnerSubscriber.js:23)
    at InnerSubscriber.Subscriber.next (Subscriber.js:89)
    at Object.subscribeToResult (subscribeToResult.js:16)
    at MergeMapSubscriber._innerSub (mergeMap.js:120)
    at MergeMapSubscriber._tryNext (mergeMap.js:117)
    at MergeMapSubscriber._next (mergeMap.js:100) TypeError: r.create is not a function
    at MapSubscriber.project (http://localhost:4200/main.bundle.js:9952:25)
    at MapSubscriber._next (http://localhost:4200/main.bundle.js:14417:35)
    at MapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:3004:18)
    at MergeMapSubscriber.notifyNext (http://localhost:4200/main.bundle.js:10204:30)
    at InnerSubscriber._next (http://localhost:4200/main.bundle.js:43255:21)
    at InnerSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:3004:18)
    at Object.subscribeToResult (http://localhost:4200/main.bundle.js:21714:25)
    at MergeMapSubscriber._innerSub (http://localhost:4200/main.bundle.js:10191:38)
    at MergeMapSubscriber._tryNext (http://localhost:4200/main.bundle.js:10188:14)
    at MergeMapSubscriber._next (http://localhost:4200/main.bundle.js:10171:18)
consoleError @ zone.js:355
_loop_1 @ zone.js:382
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): TypeError: r.create is not a function
    at resolvePromise (zone.js:429)
    at zone.js:406
    at Object.onInvoke (ng_zone.js:238)
    at Zone.run (zone.js:96)
    at zone.js:462
    at ZoneDelegate.invokeTask (zone.js:236)
    at Object.onInvokeTask (ng_zone.js:229)
    at ZoneDelegate.invokeTask (zone.js:235)
    at Zone.runTask (zone.js:136)
    at drainMicroTaskQueue (zone.js:368)
consoleError @ zone.js:357
_loop_1 @ zone.js:382
drainMicroTaskQueue @ zone.js:386
ZoneTask.invoke @ zone.js:308

@filipesilva
Copy link
Contributor

Roger, will look at it. Thanks for the report and research btw, it's appreciated!

@Meligy
Copy link
Contributor Author

Meligy commented Oct 17, 2016

Thanks heaps, man. It means a lot.

On similar note, and NOT just returning the kind words, but you are truly superior. You are all over the place keeping the place in order, and shipping more awesomeness at the same time. You and the other maintainers are true heroes 💪

@filipesilva
Copy link
Contributor

Heh, thanks ^^. We just really wanna see this work for users so we do put in a lot.

AoT+bundling+lazy loading is THE big problem we're trying to tool around atm so we really need to get these kinks out and it's super useful to have detailed issues describing the broken scenarios.

@a5hik
Copy link

a5hik commented Oct 31, 2016

@filipesilva Do we have an update on this problem?

AoT+bundling+lazy loading is THE big problem we're trying to tool around atm so we really need to get these kinks out and it's super useful to have detailed issues describing the broken scenarios.

hansl added a commit to hansl/angular-cli that referenced this issue Nov 3, 2016
Before, we were using paths relative to base at all time, but these
might not be the paths we get in System.import(), therefore we have to
keep the relative path.

Also fix e2e tests.

BREAKING CHANGES: Using relative paths might lead to path clashing. We
now properly output an error in this case.

Fixes angular#2452
Fixes angular#2735
Fixes angular#2900
hansl added a commit to hansl/angular-cli that referenced this issue Nov 3, 2016
Before, we were using paths relative to base at all time, but these
might not be the paths we get in System.import(), therefore we have to
keep the relative path.

Also fix e2e tests.

BREAKING CHANGES: Using relative paths might lead to path clashing. We
now properly output an error in this case.

Fixes angular#2452
Fixes angular#2735
Fixes angular#2900
@filipesilva
Copy link
Contributor

@a5hik we're looking to fix this in #2992.

hansl added a commit to hansl/angular-cli that referenced this issue Nov 3, 2016
Before, we were using paths relative to base at all time, but these
might not be the paths we get in System.import(), therefore we have to
keep the relative path.

Also fix e2e tests.

BREAKING CHANGES: Using relative paths might lead to path clashing. We
now properly output an error in this case.

Fixes angular#2452
Fixes angular#2735
Fixes angular#2900
hansl added a commit that referenced this issue Nov 3, 2016
…2992)

Before, we were using paths relative to base at all time, but these
might not be the paths we get in System.import(), therefore we have to
keep the relative path.

Also fix e2e tests.

BREAKING CHANGES: Using relative paths might lead to path clashing. We
now properly output an error in this case.

Fixes #2452
Fixes #2735
Fixes #2900
@joaogarin
Copy link

joaogarin commented Nov 3, 2016

@hansl regarding the ngtools/webpack for non-cli users, this fix is being pushed to the @ngtools/webpack as well right ?

@hansl
Copy link
Contributor

hansl commented Nov 3, 2016

When we release, yes.

@maxime1992
Copy link
Contributor

maxime1992 commented Nov 24, 2016

Just for information, AOT is now working with lazy loaded modules (in angular-cli 1.0.0-beta.21) ! See #2452

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
…ngular#2992)

Before, we were using paths relative to base at all time, but these
might not be the paths we get in System.import(), therefore we have to
keep the relative path.

Also fix e2e tests.

BREAKING CHANGES: Using relative paths might lead to path clashing. We
now properly output an error in this case.

Fixes angular#2452
Fixes angular#2735
Fixes angular#2900
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants