briot / geneapro

Genealogical software based on the GenTech data model
http://briot.github.com/geneapro/
GNU General Public License v2.0
33 stars 8 forks source link

Getting a type error on `npm start` #24

Closed changeling closed 6 years ago

changeling commented 6 years ago

I'm getting the following error whenever I run either setup.sh or npm start.

I've tried the following node installs: v7.7.3 v7.10.1 v8.0.0 v8.1.0 v7.7.3 v9.11.1

Failed to compile.

./src/Stats/Page.tsx
(101,3): error TS2345: Argument of type 'typeof StatsPageConnected' is not assignable to parameter of type 'ComponentType<{ persons: PersonSet; decujusid: number; } & { dispatch: Dispatch<AppState>; } & Ro...'.
  Type 'typeof StatsPageConnected' is not assignable to type 'StatelessComponent<{ persons: PersonSet; decujusid: number; } & { dispatch: Dispatch<AppState>; }...'.
    Type 'typeof StatsPageConnected' provides no match for the signature '(props: { persons: PersonSet; decujusid: number; } & { dispatch: Dispatch<AppState>; } & RouteComponentProps<PropsFromRoute> & { children?: ReactNode; }, context?: any): ReactElement<any> | null'.
briot commented 6 years ago

I'm getting the following error whenever I run either setup.sh or npm start.

I've tried the following node installs: v7.7.3 v7.10.1 v8.0.0 v8.1.0 v7.7.3 v9.11.1

This is more likely related to a different version of typescript. Can you run the following:

grep version node_modules/typescript/package.json

I am using 2.5.3 here

changeling commented 6 years ago

This is more likely related to a different version of typescript. Can you run the following:

grep version node_modules/typescript/package.json

Done:

"version": "2.5.3",
changeling commented 6 years ago

Any thoughts on further debugging on my end?

I have much experience with Python, but am just becoming familiar with JS. I'm unsure how to proceed. Thanks!

briot commented 6 years ago

Any thoughts on further debugging on my end? I have much experience with Python, but am just becoming familiar with JS. I'm unsure how to proceed. Thanks!

Thanks for the proposal. I spent some time debugging yesterday, by deleting node_modules and restarting from scratch. But now I am getting compilation errors in third party modules, so I guess I had done some local changes to those modules… Trying to fix that situation, before I can investigate things on geneaprove’s own code…

Will let you know the state of things Emmanuel

changeling commented 6 years ago

Thank you, Emmanuel! Let me know if I can help test things out.

briot commented 6 years ago

Thank you, Emmanuel! Let me know if I can help test things out.

I think it is fixed now. I managed to reproduce the same errors you were seeing. The code was indeed incorrect, but for some reason my previous setup did not show them. Seems like with react/typescript/javascript it is best to regularly delete the node_modules/ directory and restart from scratch from a clean slate.

changeling commented 6 years ago

Looks like that did indeed fix these errors. Thank you again. Perhaps having a --reset option in setup.sh, or a separate reset.sh script might be an idea to consider for folks who are having issues.

briot commented 6 years ago

Looks like that did indeed fix these errors. Thank you again. Perhaps having a --reset option in setup.sh, or a separate reset.sh script might be an idea to consider for folks who are having issues.

Could you perhaps open a github issue for that suggestion so that it doesn’t get lost ? Thanks for your pull requests, too !

changeling commented 6 years ago

Doing so now. And you're welcome!

(For what it is worth, that was my very first PR on GitHub ever. Let me know if I did it correctly, or if I should do differently in the future.)

briot commented 6 years ago

(For what it is worth, that was my very first PR on GitHub ever. Let me know if I did it correctly, or if I should do differently in the future.)

All good. I perhaps would not have made so many small commits myself, I think I would have merged them, but it doesn’t matter all that much in practice