英文:
Huge ngrx createEffect causes a strange error after upgrade, which disappears if different pieces of code such as tap or filter are commented
问题
I'm upgrading a huge Angular 12 project to Angular 13 and did many steps.
Effects were also rewritten in a newer way such as
createEffect(() =>
instead of
@Effect
Unfortunately, the upgrade caused several effects to be broken. The fast fix to avoid errors and run the app was to apply { dispatch: false }
. Unfortunately, that was not a fix and it broke the logic. I've tried to fix each broken effect step by step. For one huge effect the error is:
which unexpectedly gets fixed by commenting
filter(...),
block, or another filter(...),
block, or tap(..)
in this large and long (many lines) Effect.
Are there limitations that I'm missing? Why is this error happening? Why it gets fixed by commenting simple pieces of this Effect?
As an example, if I comment any of several filters in different places, as an example this (params are renamed):
// filter(
// ([
// param1,
// param2,
// param3,
// param4,
// param5,
// param6,
// param7,
// param8,
// param9,
// param10,
// param11,
// param12
// ]) => !!param11.id
// ),
英文:
I'm upgrading a huge Angular 12 project to Angular 13 and did many steps.
Effects were also rewritten in a newer way such as
createEffect(() =>
instead of
@Effect
Unfortunately, the upgrade caused several effects to be broken. The fast fix to avoid errors and run the app was to apply { dispatch: false }
. Unfortunately, that was not a fix and it broke the logic. I've tried to fix each broken effect step by step. For one huge effect the error is:
which unexpectedly gets fixed by commenting
filter(...),
block , or another filter(...),
block, or tap(..)
in this large and long (many lines) Effect.
Are there limitations that I'm missing? Why is this error happening? Why it gets fixed by commenting simple pieces of this Effect?
As example, if I comment any of several filters in different places, as example this (params are renamed):
// filter(
// ([
// param1,
// param2,
// param3,
// param4,
// param5,
// param6,
// param7,
// param8,
// param9,
// param10,
// param11,
// param12
// ]) => !!param11.id
// ),
答案1
得分: 0
Adding any has helped:
createEffect((): any => this.actions$.pipe(
英文:
Adding any has helped:
createEffect((): any => this.actions$.pipe(
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论