mobxjs / mobx-angular

The MobX connector for Angular.
MIT License
483 stars 59 forks source link

Upgrade from 1.3.0 to 1.4.1 failing #28

Closed Jonatthu closed 7 years ago

Jonatthu commented 7 years ago

When I was on 1.3.0 everything was working fine but with the latest version is failing and giving me the next error:

ng:///AppModule/AppComponent.ngfactory.js:1429 ERROR CONTEXT DebugContext_
View_AppComponent_0 @ ng:///AppModule/AppComponent.ngfactory.js:1429
polyfills.bundle.js:7134 Unhandled Promise rejection: Cannot read property 'context' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'context' of undefined
    at MobxAutorunDirective.autoDetect (vendor.bundle.js:73005)
    at MobxAutorunDirective.ngOnInit (vendor.bundle.js:73001)
    at checkAndUpdateDirectiveInline (vendor.bundle.js:10971)
    at checkAndUpdateNodeInline (vendor.bundle.js:12349)
    at checkAndUpdateNode (vendor.bundle.js:12317)
    at debugCheckAndUpdateNode (vendor.bundle.js:12946)
    at debugCheckDirectivesFn (vendor.bundle.js:12887)
    at Object.eval [as updateDirectives] (ng:///AppModule/AppComponent.ngfactory.js:1439)
    at Object.debugUpdateDirectives [as updateDirectives] (vendor.bundle.js:12872)
    at checkAndUpdateView (vendor.bundle.js:12284)
    at callViewAction (vendor.bundle.js:12599)
    at execComponentViewsAction (vendor.bundle.js:12545)
    at checkAndUpdateView (vendor.bundle.js:12290)
    at callWithDebugContext (vendor.bundle.js:13272)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (vendor.bundle.js:12812) TypeError: Cannot read property 'context' of undefined
    at MobxAutorunDirective.autoDetect (http://localhost:4200/vendor.bundle.js:73005:114)
    at MobxAutorunDirective.ngOnInit (http://localhost:4200/vendor.bundle.js:73001:14)
    at checkAndUpdateDirectiveInline (http://localhost:4200/vendor.bundle.js:10971:19)
    at checkAndUpdateNodeInline (http://localhost:4200/vendor.bundle.js:12349:17)
    at checkAndUpdateNode (http://localhost:4200/vendor.bundle.js:12317:16)
    at debugCheckAndUpdateNode (http://localhost:4200/vendor.bundle.js:12946:59)
    at debugCheckDirectivesFn (http://localhost:4200/vendor.bundle.js:12887:13)
    at Object.eval [as updateDirectives] (ng:///AppModule/AppComponent.ngfactory.js:1439:5)
    at Object.debugUpdateDirectives [as updateDirectives] (http://localhost:4200/vendor.bundle.js:12872:21)
    at checkAndUpdateView (http://localhost:4200/vendor.bundle.js:12284:14)
    at callViewAction (http://localhost:4200/vendor.bundle.js:12599:17)
    at execComponentViewsAction (http://localhost:4200/vendor.bundle.js:12545:13)
    at checkAndUpdateView (http://localhost:4200/vendor.bundle.js:12290:5)
    at callWithDebugContext (http://localhost:4200/vendor.bundle.js:13272:42)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (http://localhost:4200/vendor.bundle.js:12812:12)
consoleError @ polyfills.bundle.js:7134
polyfills.bundle.js:7136 Error: Uncaught (in promise): TypeError: Cannot read property 'context' of undefined
TypeError: Cannot read property 'context' of undefined
    at MobxAutorunDirective.autoDetect (vendor.bundle.js:73005)
    at MobxAutorunDirective.ngOnInit (vendor.bundle.js:73001)
    at checkAndUpdateDirectiveInline (vendor.bundle.js:10971)
    at checkAndUpdateNodeInline (vendor.bundle.js:12349)
    at checkAndUpdateNode (vendor.bundle.js:12317)
    at debugCheckAndUpdateNode (vendor.bundle.js:12946)
    at debugCheckDirectivesFn (vendor.bundle.js:12887)
    at Object.eval [as updateDirectives] (ng:///AppModule/AppComponent.ngfactory.js:1439)
    at Object.debugUpdateDirectives [as updateDirectives] (vendor.bundle.js:12872)
    at checkAndUpdateView (vendor.bundle.js:12284)
    at callViewAction (vendor.bundle.js:12599)
    at execComponentViewsAction (vendor.bundle.js:12545)
    at checkAndUpdateView (vendor.bundle.js:12290)
    at callWithDebugContext (vendor.bundle.js:13272)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (vendor.bundle.js:12812)
    at MobxAutorunDirective.autoDetect (vendor.bundle.js:73005)
    at MobxAutorunDirective.ngOnInit (vendor.bundle.js:73001)
    at checkAndUpdateDirectiveInline (vendor.bundle.js:10971)
    at checkAndUpdateNodeInline (vendor.bundle.js:12349)
    at checkAndUpdateNode (vendor.bundle.js:12317)
    at debugCheckAndUpdateNode (vendor.bundle.js:12946)
    at debugCheckDirectivesFn (vendor.bundle.js:12887)
    at Object.eval [as updateDirectives] (ng:///AppModule/AppComponent.ngfactory.js:1439)
    at Object.debugUpdateDirectives [as updateDirectives] (vendor.bundle.js:12872)
    at checkAndUpdateView (vendor.bundle.js:12284)
    at callViewAction (vendor.bundle.js:12599)
    at execComponentViewsAction (vendor.bundle.js:12545)
    at checkAndUpdateView (vendor.bundle.js:12290)
    at callWithDebugContext (vendor.bundle.js:13272)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (vendor.bundle.js:12812)
    at resolvePromise (polyfills.bundle.js:7277) [<root>]
    at :4200/polyfills.bundle.js:7203:17 [<root>]
    at :4200/polyfills.bundle.js:7219:33 [<root>]
    at Zone.run (polyfills.bundle.js:6690) [<root> => <root>]
    at :4200/polyfills.bundle.js:7325:57 [<root>]
    at Zone.runTask (polyfills.bundle.js:6730) [<root> => <root>]
    at drainMicroTaskQueue (polyfills.bundle.js:7158) [<root>]
consoleError @ polyfills.bundle.js:7136

Versions: Angular: 4 Mobx: 2.1.8 mobx-angular: 1.4.1

returnlytom commented 7 years ago

Think this is solved by https://github.com/mobxjs/mobx-angular/pull/27

Jonatthu commented 7 years ago

@returnlytom So this will need an update to 1.4.2?

returnlytom commented 7 years ago

Will defer to @adamkleingit but yes a version bump is probably necessary

adamkleingit commented 7 years ago

Published in 1.4.2. Thanks for the PR