Skip to content

@ngrx/effects/src/effect_creator.d.ts:12:43 - error TS2313: Type parameter 'OT' has a circular constraint. #4275

Description

@gclapham

Which @ngrx/* package(s) are the source of the bug?

effects

Minimal reproduction of the bug/regression with instructions

When trying to compile code in an Nx monorepo I get the following Error:
12 }, DT extends DispatchType<C>, OT extends ObservableType<DT, OT>, R extends EffectResult<OT>>(source: () => R & ConditionallyDisallowActionCreator<DT, R>, config?: C): R & CreateEffectMetadata;

Expected behavior

It should not throw a TypeScript Error.
I have tried adding to the the following to the base tsconfig

  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "strict": false,
    "noImplicitReturns": false,
    "noFallthroughCasesInSwitch": true,
    "paths": {
      "@ngrx/effects": ["node_modules/@ngrx/effects"],
      "@ngrx/effects/*": ["node_modules/@ngrx/effects/*"]
    },
  },

There are, however, dozens of tsconfigs, as this is a monorepo. They mostly inherit form a base config, but not all.
I may be able to add it to one of those configs and have it work. It would be preferable that the code did not trigger TS type checking.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

Node : 18.19.1
OS : darwin-arm64
yarn : 1.22.21

nx (global) : 18.0.7
nx : 18.0.7
@nx/js : 18.1.0
@nx/jest : 18.1.0
@nx/linter : 18.1.0
@nx/eslint : 18.1.0
@nx/workspace : 18.1.0
@nx/angular : 18.1.0
@nx/cypress : 18.1.0
@nx/devkit : 18.1.0
@nx/eslint-plugin : 18.1.0
@nrwl/tao : 18.0.7
@nx/web : 18.1.0
@nx/webpack : 18.1.0
typescript : 5.4.2

Community plugins:
@ng-bootstrap/ng-bootstrap : 16.0.0
@ngrx/component-store : 17.1.1
@ngrx/effects : 17.1.1
@ngrx/entity : 17.1.1
@ngrx/router-store : 17.1.1
@ngrx/schematics : 17.1.1
@ngrx/store : 17.1.1
@ngrx/store-devtools : 17.1.1
ng-mocks : 12.5.1

The following packages should match the installed version of nx

  • @nx/js@18.1.0
  • @nrwl/js@18.1.0
  • @nx/jest@18.1.0
  • @nrwl/jest@18.1.0
  • @nx/linter@18.1.0
  • @nx/eslint@18.1.0
  • @nx/workspace@18.1.0
  • @nrwl/workspace@18.1.0
  • @nx/angular@18.1.0
  • @nrwl/angular@18.1.0
  • @nx/cypress@18.1.0
  • @nrwl/cypress@18.1.0
  • @nx/devkit@18.1.0
  • @nrwl/devkit@18.1.0
  • @nx/eslint-plugin@18.1.0
  • @nrwl/eslint-plugin-nx@18.1.0
  • @nx/web@18.1.0
  • @nrwl/web@18.1.0
  • @nx/webpack@18.1.0
  • @nrwl/webpack@18.1.0

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions