Fluentui: Build error with SPFX @uifabric : error TS1005

Created on 20 Feb 2019  路  4Comments  路  Source: microsoft/fluentui

Environment Information

  • __Package version(s)__: 6.141.1
  • __Browser and OS versions__: Windows 10 / Chrome

Actual behavior:

New webpart project using YO generator, with SPFX v1.7.1

When adding component, or any other Fabric UI component, project won't build ;

Error - [tsc] node_modules/@uifabric/foundation/lib/ISlots.d.ts(68,124): error TS1005: ')' expected.
Error - [tsc] node_modules/@uifabric/foundation/lib/ISlots.d.ts(68,177): error TS1005: '(' expected.
Error - [tsc] node_modules/@uifabric/foundation/lib/ISlots.d.ts(68,185): error TS1005: ':' expected.

Error - [tsc] node_modules/@uifabric/foundation/node_modules/@uifabric/merge-styles/lib/IStyleSet.d.ts(15,67): error TS1005: ';' expected.
Error - [tsc] node_modules/@uifabric/foundation/node_modules/@uifabric/merge-styles/lib/IStyleSet.d.ts(15,114): error TS1005: '(' expected.
Error - [tsc] node_modules/@uifabric/foundation/node_modules/@uifabric/merge-styles/lib/IStyleSet.d.ts(15,136): error TS1005: '(' expected.

Error - [tsc] node_modules/office-ui-fabric-react/node_modules/@uifabric/merge-styles/lib/IStyleSet.d.ts(15,67): error TS1005: ';' expected.
Error - [tsc] node_modules/office-ui-fabric-react/node_modules/@uifabric/merge-styles/lib/IStyleSet.d.ts(15,114): error TS1005: '(' expected.
Error - [tsc] node_modules/office-ui-fabric-react/node_modules/@uifabric/merge-styles/lib/IStyleSet.d.ts(15,136): error TS1005: '(' expected.
Error - 'tsc' sub task errored after 31 s

tslint version: 5.9.1
typescript version: 2.4.2
node 8.12.0


1st error - is within this line (ISlots.d.ts);

export declare type ISlotPropValue = TShorthandPropType | TProps | (TShorthandPropType extends React.ReactNode ? IPropsWithChildren : never);


2nd error - is within this line (IStyleSet.d.ts)

export declare type __MapToFunctionType = Extract extends never ? (...args: any[]) => Partial : Extract;


2nd error - is within this line (IStyleSet.d.ts)

export declare type __MapToFunctionType = Extract extends never ? (...args: any[]) => Partial : Extract;

Expected behavior:

Project will build - and not trip up on errors within these three (3) files

?? Is this a typescript compiler issue - and code is using 'new' method features ?

Priorities and help requested:

Are you willing to submit a PR to fix? (No)

Requested priority: (Blocking)

Products/sites affected: (if applicable)
SPFX, webpart project

Author Feedback Duplicate External

Most helpful comment

@kachihro I recommend asking this question at https://github.com/SharePoint/sp-dev-docs. The UI Fabric team is not in a position to speak authoritatively about SPFx's release plans unfortunately...

All 4 comments

@kachihro Can you try updating your Typescript to 2.8.4? This is what office-ui-fabric-react's on so you should be able to compile then.

I'm wondering if it's a restriction with SPFX - v1.7... Other projects, and the scaffold refer to Office UI Fabric React as v5.3.1 - does it mean that we can't include the new components (like Stack) within an SPFX webpart...? When can we expect an update to SPFX for more recent components ?

@kachihro I recommend asking this question at https://github.com/SharePoint/sp-dev-docs. The UI Fabric team is not in a position to speak authoritatively about SPFx's release plans unfortunately...

Duplicate of #7054

Was this page helpful?
0 / 5 - 0 ratings