Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS2344 when using 0.6.0-beta.2 #155

Closed
Half-Shot opened this issue Sep 20, 2021 · 3 comments
Closed

TS2344 when using 0.6.0-beta.2 #155

Half-Shot opened this issue Sep 20, 2021 · 3 comments

Comments

@Half-Shot
Copy link
Contributor

node_modules/matrix-bot-sdk/lib/e2ee/CryptoClient.d.ts:109:84 - error TS2344: Type 'unknown' does not satisfy the constraint 'Object'.

109     decryptRoomEvent(event: EncryptedRoomEvent, roomId: string): Promise<RoomEvent<unknown>>;

Apologies for filing an issue on a clearly-beta release, but this seems to be a blocker for using the lib in a TS environment.

@turt2live
Copy link
Owner

What is your tsconfig? I've used the beta in about 3 TS projects since launch with zero issues :s

@Half-Shot
Copy link
Contributor Author

Half-Shot commented Sep 20, 2021

{
  "compilerOptions": {
    "target": "ES2017",
    "module": "commonjs",
    "allowJs": true,
    "outDir": "./lib",
    "rootDir": "./src",
    "strict": true,
    "incremental": true,
    "esModuleInterop": true,
    "noImplicitAny": false,
    "experimentalDecorators": true,
    "sourceMap": true,
    // Uncommenting this makes the builds work, but is obviously not ideal.
    // "skipLibCheck": true,
  },
  "include": [
    "src/**/*"
  ],
}

with TS 4.3.5

@turt2live
Copy link
Owner

hmm, strange. The strict: true might be doing it, but I guess it's a valid error. Going to handle this by changing the types of RoomEvent instead (as Record<A, B> is not my favourite).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants