Closed parkerault closed 5 years ago
Hey, are you sure these errors are reported by TS version supplied with the project?
On Fri, Jun 28, 2019, 8:52 PM parkerault notifications@github.com wrote:
There don't seem to be any problems reported by tsc so no big deal, but the VSCode problems tab is reporting several issues in the playground project. I know this is outside of the scope of your work on this project, but this can definitely trip up new typescript users like myself.
src/features/todos/epics.spec.ts
Cannot find module 'MyTypes'. No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments.
src/features/todos/reducer.spec.ts
Module '"."' has no exported member 'TodosState'.
src/hoc/with-error-boundary.tsx
Conversion of type 'ComponentType
' to type 'ComponentType ' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'FunctionComponent ' is not comparable to type 'ComponentType '. Type 'FunctionComponent ' is not comparable to type 'FunctionComponent '. Types of parameters 'props' and 'props' are incompatible. Type 'PropsWithChildren ' is not comparable to type 'PropsWithChildren '. Type 'PropsWithChildren ' is not comparable to type 'BaseProps'. 'PropsWithChildren ' is assignable to the constraint of type 'BaseProps', but 'BaseProps' could be instantiated with a different subtype of constraint 'InjectedProps'. src/hoc/with-state.tsx
Conversion of type 'ComponentType
' to type 'ComponentType ' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'FunctionComponent ' is not comparable to type 'ComponentType '. Type 'FunctionComponent ' is not comparable to type 'FunctionComponent '. Types of parameters 'props' and 'props' are incompatible. Type 'PropsWithChildren ' is not comparable to type 'PropsWithChildren '. Type 'PropsWithChildren ' is not comparable to type 'BaseProps'. 'PropsWithChildren ' is assignable to the constraint of type 'BaseProps', but 'BaseProps' could be instantiated with a different subtype of constraint 'InjectedProps'. Screenshot of full list of errors:
[image: image] https://user-images.githubusercontent.com/78856/60364094-f9720500-99aa-11e9-91eb-c100ad4eae91.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/piotrwitek/react-redux-typescript-guide/issues/172?email_source=notifications&email_token=AAFUOA47M7BHAXPI6UB76CDP4ZMWDA5CNFSM4H4HX222YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4MCWEQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFUOA4ZLNLTN5H746FIGH3P4ZMWDANCNFSM4H4HX22Q .
Looks like it's running 3.5.1. I hadn't looked up how VSCode manages typescript versions, but apparently it uses the latest stable version unless you point it at a custom tsc binary in the settings.
In general, if you have typescript installed in your node_modules dependencies you should use that instead of the default one. I'm closing this as this is a false alert.
Also please notice that at the top of the repo you have listed the supported TS version.
There don't seem to be any problems reported by
tsc
so no big deal, but the VSCode problems tab is reporting several issues in the playground project. I know this is outside of the scope of your work on this project, but this can definitely trip up new typescript users like myself.src/features/todos/epics.spec.ts
src/features/todos/reducer.spec.ts
src/hoc/with-error-boundary.tsx
src/hoc/with-state.tsx
Screenshot of full list of errors: