question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CASL fails to compile with Typescript 4.3.X

See original GitHub issue

Describe the bug CASL is not compatible with Typescript 4.3.x and fails compilation

To Reproduce Steps to reproduce the behavior:

  1. Install @casl/ability v5.3.1 and typescript v4.3.x
  2. tsc ./

Expected behavior CASL should not fail compilation when using Typescript 4.3.x

Current behavior Typescript outputs the following:

node_modules/@casl/ability/dist/types/matchers/conditions.d.ts:26:5 - error TS2502: 'produce' is referenced directly or indirectly in its own type annotation.

26     produce: MongoQuery<this[0]>;

Related file: https://github.com/stalniy/casl/blob/master/packages/casl-ability/src/matchers/conditions.ts#L71

CASL Version @casl/ability v5.3.1

Environment: Node v14.16.1 Typescript 4.3.4 @casl/ability 5.3.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
stalniycommented, Aug 7, 2021

Thanks for the issue. Need some time to investigate it. Will do this in couple days

0reactions
stalniycommented, Sep 6, 2021

Could you please make a simple repo with basic example that doesn’t work? As I said, in my primitive testing it works, maybe it’s an integration issue with sequelize and TypeORM

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to compile main process with typescript 4.3 and class ...
Describe the bug After upgrading TypeScript to 4.3.x main process bundle no longer builds if there's a class with private field.
Read more >
Error: TSError: Unable to compile TypeScript - Stack Overflow
I had met same issue. First I remove ts-node and typescript from package.json . then, npm install ts-node --save-dev npm install typescript ......
Read more >
Documentation - TypeScript 4.3
That's why TypeScript 4.3 allows you to specify types for reading and writing to properties. let num = Number ( value ); //...
Read more >
TypeScript Compiling with Visual Studio Code
It offers classes, modules, and interfaces to help you build robust components. Install the TypeScript compiler. Visual Studio Code includes TypeScript language ...
Read more >
Compile and build TypeScript code using NuGet
Learn how to add TypeScript support to your Visual Studio projects by using the NuGet package.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found