Description
Is this a regression?
Yes
Description
After updating angular v11 to v16 the akita is giving error in angular
main.js:23 ERROR TypeError: this.userQuery.select is not a function at main.js:1:262487 at u.<computed> (polyfills.js:23:32704) at A.invokeTask (polyfills.js:23:9550) at Object.onInvokeTask (main.js:23:169287) at A.invokeTask (polyfills.js:23:9471) at A.runTask (polyfills.js:23:4559) at A.invokeTask (polyfills.js:23:10688) at A.invoke (polyfills.js:23:10578) at Z.s.args.<computed> (polyfills.js:23:32402)
my code chunk that raise this error is,
`ngOnInit(): void {
if (environment.phone) {
document.body.classList.add('phone');
} else {
document.body.classList.add('tablet');
}
this.screenOrientationService.lockPhone('portrait');
const userQuerySubscription = this.userQuery
.select('accessToken')
.pipe(
filter((v) => !!v),
first()
)
.subscribe(() => this.userStore.getDetails());
this.subscriptions.add(userQuerySubscription);`
I suspect that might be angular is consuming the state/store before it's avilable. Anyone else have such issue in new angular version? as it was working fine in old v11 of angular.
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
main.js:23 ERROR TypeError: this.userQuery.select is not a function
at main.js:1:262487
at u.<computed> (polyfills.js:23:32704)
at A.invokeTask (polyfills.js:23:9550)
at Object.onInvokeTask (main.js:23:169287)
at A.invokeTask (polyfills.js:23:9471)
at A.runTask (polyfills.js:23:4559)
at A.invokeTask (polyfills.js:23:10688)
at A.invoke (polyfills.js:23:10578)
at Z.s.args.<computed> (polyfills.js:23:32402)
Please provide the environment you discovered this bug in
development
Anything else?
I'm suspecting that angular v16 consume stores/queries before they are avilable resulting in undefined.
Do you want to create a pull request?
No