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

Redux and Redux thunk throw errors at gulp serve #1

Open
stethelast opened this issue Nov 6, 2018 · 4 comments
Open

Redux and Redux thunk throw errors at gulp serve #1

stethelast opened this issue Nov 6, 2018 · 4 comments

Comments

@stethelast
Copy link

Hi

I assume this is because the language has moved on since your book was published so this is a cry for help more than anything. I follow the instructions in your book and when I've put all the code into Tasktracker web part, I get a bunch of errors from gulp serve.

Error - typescript - node_modules\redux-thunk\index.d.ts(13,30): error TS1005: ',' expected.
Error - typescript - node_modules\redux-thunk\index.d.ts(13,32): error TS1005: '>' expected.
Error - typescript - node_modules\redux-thunk\index.d.ts(13,34): error TS1005: ';' expected.
Error - typescript - node_modules\redux-thunk\index.d.ts(13,38): error TS1005: ';' expected.
Error - typescript - node_modules\redux-thunk\index.d.ts(13,81): error TS1109: Expression expected.
Error - typescript - node_modules\redux-thunk\index.d.ts(13,144): error TS1005: '(' expected.
Error - typescript - node_modules\redux\index.d.ts(17,26): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(57,22): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(57,46): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(67,32): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(67,56): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(92,52): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(119,43): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(138,25): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(138,49): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(288,30): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(288,32): error TS1005: '>' expected.
Error - typescript - node_modules\redux\index.d.ts(288,34): error TS1005: ';' expected.
Error - typescript - node_modules\redux\index.d.ts(288,51): error TS1109: Expression expected.
Error - typescript - node_modules\redux\index.d.ts(291,0): error TS1109: Expression expected.
Error - typescript - node_modules\redux\index.d.ts(291,42): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(291,44): error TS1005: '>' expected.
Error - typescript - node_modules\redux\index.d.ts(291,46): error TS1005: ';' expected.
Error - typescript - node_modules\redux\index.d.ts(291,63): error TS1109: Expression expected.
Error - typescript - node_modules\redux\index.d.ts(292,4): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(293,19): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(297,28): error TS1005: '(' expected.
Error - typescript - node_modules\redux\index.d.ts(301,0): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(301,50): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(301,64): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(321,14): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(321,16): error TS1005: '>' expected.
Error - typescript - node_modules\redux\index.d.ts(321,18): error TS1128: Declaration or statement expected.
Error - typescript - node_modules\redux\index.d.ts(323,4): error TS1005: ';' expected.
Error - typescript - node_modules\redux\index.d.ts(325,2): error TS1136: Property assignment expected.
Error - typescript - node_modules\redux\index.d.ts(325,6): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(325,27): error TS1005: '(' expected.
Error - typescript - node_modules\redux\index.d.ts(325,28): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(328,0): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(350,0): error TS1135: Argument expression expected.
Error - typescript - node_modules\redux\index.d.ts(376,39): error TS1005: ',' expected.
Error - typescript - node_modules\redux\index.d.ts(406,43): error TS1005: ',' expected.
Error - typescript - node_modules\sp-pnp-js\lib\sharepoint\clientsidepages.d.ts(104,44): error TS1005: ',' expected.
Error - typescript - node_modules\sp-pnp-js\lib\sharepoint\clientsidepages.d.ts(110,40): error TS1005: ',' expected.
Error - typescript - src\webparts\tasktracker\Store.ts(13,43): error TS2314: Generic type 'Store<S, any, A, AnyAction>' requires 4 type argument(s).

I've tried searching online for solutions and they tell me to make sure Typescript is more than 2.3.4 and as far as I can tell it already is.

Do you already have this fixed or know what the problem is please?

Thanks
Steve

@djimenezv
Copy link
Owner

djimenezv commented Nov 8, 2018 via email

@stethelast
Copy link
Author

So dunno if this helps but I've been posting on StackExchange and this problem, I think seems to be down to most tutorials requesting that you install office-ui-fabric-react - I think I've figured out that this is bad advice, this would install the latest version of that library and actually the one you want is the one already shipping with the scaffolding that yeoman does. So I think if you're suggesting that users install office-ui-fabric-react then that's an issue. It seems to already be a dependency on @microsoft/sp-office-ui-fabric-core or similar.

@stethelast
Copy link
Author

OK so been trying to fix this for days and going round and round in circles - the problem is that SFPX requires a very narrow set of versions of typescript i.e. between 2.2.2 and 2.4.2. Doing an install of react-redux, redux and redux-thunk installs the latest version and these depend on a later version of typescript. It has taken me days to work this out because I cannot find it documented anywhere and NPM is just a frustrating little black box. So in order to be clear - you must have for version 1.7.0 of @microsoft/sharepoint-generator - 2.2.2 to 2.4.2 of typescript, "react-redux": "5.0.6", "redux": "3.7.2", "redux-thunk": "2.2.0", "sp-pnp-js": "3.0.1". Also DON'T install office-ui-fabric-react at all, this already is brought in as a dependency on another library - if you install anything but that version that also breaks in the same way. I for one cannot understand how SPFX can be the microsoft supported way of doing Sharepoint dev, but the basic libraries it uses, office-ui-fabric, sp-pnp-js have moved on massively from the current supported version.

@colacat2
Copy link

I totally agree. Office-ui-fabric was recently updated and now I cannot get anything to work anymore. The dependencies don't work together because every dependency requires a different version somewhere. Whatever compiles fine today, might fail tomorrow. This SPFX Framework development turns more and more into a nightmare.

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

3 participants