So the only answers that even vaguely approach answering this seem to be on here. I'm pretty new to SPFX but am trying to build some book examples of React-Redux and I always come up against the same problems. First I download the samples, or implement the tutorials and they seem to work and serve fine until you get to add anything using office-ui-fabric-react controls. In this case:
<PrimaryButton
onClick={this.saveClick.bind(this)}
style={ { 'marginRight': '8px' } } >
Save
</PrimaryButton>
So this appears to be the version that ships with SPFX and I get onClick underlined and the error:
Property 'onClick' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes'
This is before I run gulp serve or try a build.
To get rid of this error I ended up reverting the version of office-ui-fabric-react to 4.14.1 and this now stops the error appearing in problems in VS Code - also had to revert the Typescript version to 2.2 from 3.x because it doesn't seem to play nice. But now when I try and run gulp serve I get about 50 errors that look like:
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(18,59): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(18,61): error TS1005: '>' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(18,63): error TS1109: Expression expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(18,65): error TS1109: Expression expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(23,62): error TS1109: Expression expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(23,63): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(29,48): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(30,19): error TS1005: ':' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(31,20): error TS1005: ':' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(32,25): error TS1005: ':' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(33,22): error TS1005: ':' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(34,23): error TS1005: ':' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(44,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(48,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(52,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(56,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(56,30): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(60,50): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(67,36): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(74,42): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(84,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(91,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(97,4): error TS1005: ',' expected.
[10:33:52] Error - typescript - node_modules\@uifabric\utilities\lib\BaseComponent.d.ts(105,4): error TS1005: ',' expected.
I get a bunch of other build errors as well but these are consistently always there. Most answers seem to tell me to change my version of typescript (2.2.2) or office-ui-fabric-react (4.14.1) but I've tried multiple versions to no avail.
Does anyone know what's happening and how I even start to debug the problem?