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

Error with Typescript >= 2.9: Type 'keyof T' does not satisfy the constraint 'string' #31

Open
greengiraffe opened this issue Jul 8, 2018 · 1 comment

Comments

@greengiraffe
Copy link
Contributor

Using Typescript >= 2.9 an error occurs while bundling a typescript/preact/preact-redux project due to some breaking changes regarding keyof.

Versions I'm using:

preact-redux@2.0.3
typescript@2.9.2

The error:

ERROR in [at-loader] ./node_modules/preact-redux/src/preact-redux.d.ts:16:48
    TS2344: Type 'keyof T' does not satisfy the constraint 'string'.
  Type 'string | number | symbol' is not assignable to type 'string'.
    Type 'number' is not assignable to type 'string'.

A quick fix suggested over at microsoft/TypeScript#25260 (comment) is to set "keyofStringsOnly": true in the tsconfig.json

@greengiraffe
Copy link
Contributor Author

I just noticed that this will probably be fixed with this PR: #30

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

No branches or pull requests

1 participant