generator-spfx
generator-spfx copied to clipboard
SP2019 solution typescript errors
General Information
- [ ] Usage
- [ X ] Development
- [ ] Documentation
- [ ] Feature Request
Specific generator
- [ ] Addons
- [ ] HandlebarsJS
What Version you are running?
- NodeJS: 10.20.1
- NPM: 6.14..4
- @pnp/spfx: 1.15.0
Describe your problem
I created a SP2019 solution. After this i immediatly started gulp serve and then i got the following typescript errors: [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(31,37): error TS1005: '=' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(33,38): error TS1005: ';' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,46): error TS1005: ';' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,47): error TS1109: Expression expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,48): error TS1109: Expression expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,75): error TS1109: Expression expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,99): error TS1005: ';' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,102): error TS1109: Expression expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,118): error TS1109: Expression expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,143): error TS1005: ';' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,151): error TS1128: Declaration or statement expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(35,159): error TS1005: ',' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(37,49): error TS1005: ';' expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(37,50): error TS1109: Expression expected. [13:11:57] Error - typescript - node_modules@types\prop-types\index.d.ts(37,51): error TS1109: Expression expected. [13:11:58] Error - typescript - node_modules@types\prop-types\index.d.ts(37,68): error TS1005: '(' expected. [13:11:58] Error - typescript - node_modules@types\prop-types\index.d.ts(37,70): error TS1128: Declaration or statement expected. [13:11:58] Error - typescript - node_modules@types\prop-types\index.d.ts(52,29): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\prop-types\index.d.ts(52,53): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\prop-types\index.d.ts(52,56): error TS1109: Expression expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(74,50): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(75,16): error TS1005: ',' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(76,24): error TS1005: '(' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(119,14): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(119,28): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(120,12): error TS1005: '(' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(120,59): error TS1109: Expression expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(121,22): error TS1005: ',' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(123,16): error TS1109: Expression expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(125,12): error TS1005: ',' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(125,19): error TS1005: ')' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,20): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,28): error TS1131: Property or signature expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,34): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,40): error TS1005: ':' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,54): error TS1109: Expression expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,62): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(162,66): error TS1128: Declaration or statement expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(163,4): error TS1128: Declaration or statement expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(370,49): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(370,71): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(370,74): error TS1109: Expression expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(800,14): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(800,28): error TS1005: ';' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(802,12): error TS1005: '(' expected. [13:11:58] Error - typescript - node_modules@types\react\index.d.ts(802,15): error TS1005: ')' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(806,14): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(806,28): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(807,16): error TS1005: ':' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(807,30): error TS1109: Expression expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(807,38): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(808,16): error TS1128: Declaration or statement expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(808,25): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(809,41): error TS1005: '(' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(809,70): error TS1005: '(' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(810,20): error TS1005: ',' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(811,16): error TS1005: ',' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(812,12): error TS1005: ',' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(812,15): error TS1005: ')' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(821,10): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(821,46): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(822,12): error TS1109: Expression expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(823,16): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(823,30): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(827,10): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(827,39): error TS1005: ';' expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(828,12): error TS1109: Expression expected. [13:11:59] Error - typescript - node_modules@types\react\index.d.ts(828,33): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(829,12): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(829,45): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(875,55): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(875,77): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(875,85): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(876,56): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(876,83): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(876,86): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(879,10): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(879,45): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(879,48): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2820,30): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2822,12): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2822,24): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2824,12): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2825,4): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2825,5): error TS1005: ')' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2852,14): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2852,22): error TS1131: Property or signature expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2852,90): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2853,27): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2853,40): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2853,75): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2853,76): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2853,82): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2854,22): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2854,28): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2855,24): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2855,28): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2855,32): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2856,24): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2856,50): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2856,105): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2857,4): error TS1128: Declaration or statement expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2896,0): error TS1128: Declaration or statement expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2900,31): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2900,42): error TS1005: ')' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2900,70): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2900,72): error TS1128: Declaration or statement expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2900,79): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2902,70): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2902,95): error TS1128: Declaration or statement expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2902,103): error TS1005: ',' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2908,6): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2910,26): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2912,19): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2912,33): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2914,16): error TS1109: Expression expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2916,16): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2918,16): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2919,8): error TS1005: '(' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2919,15): error TS1005: ')' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2925,26): error TS1005: ';' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2926,13): error TS1005: ':' expected. [13:12:00] Error - typescript - node_modules@types\react\index.d.ts(2926,27): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2927,8): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2928,8): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2929,8): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2930,4): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2930,11): error TS1005: ')' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2932,38): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2932,65): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2932,88): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2933,4): error TS1128: Declaration or statement expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2934,4): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2934,8): error TS1005: ',' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2934,35): error TS1005: ',' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2934,36): error TS1005: ':' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2936,8): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2936,12): error TS1005: ',' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2936,42): error TS1005: ',' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2936,43): error TS1005: ':' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2938,12): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2938,15): error TS1005: ')' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2952,48): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2952,88): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2952,91): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2952,125): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2953,12): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2953,16): error TS1005: ':' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2953,56): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2953,59): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2953,93): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2954,16): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2955,16): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2956,12): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules@types\react\index.d.ts(2956,42): error TS1005: '(' expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(2,43): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(2,63): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(3,2): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(3,17): error TS1005: ':' expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(3,31): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(4,2): error TS1109: Expression expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(4,11): error TS1005: ';' expected. [13:12:01] Error - typescript - node_modules\csstype\index.d.ts(4,25): error TS1005: ';' expected. [13:12:02] Error - typescript - src\webparts\helloWorld\HelloWorldWebPart.ts(20,25): error TS2694: Namespace 'React' has no exported member 'ReactElement'. [13:12:02] Error - typescript - src\webparts\helloWorld\HelloWorldWebPart.ts(20,64): error TS2339: Property 'createElement' does not exist on type 'typeof React'. [13:12:02] Error - typescript - src\webparts\helloWorld\components\HelloWorld.tsx(5,46): error TS2339: Property 'Component' does not exist on type 'typeof React'. [13:12:02] Error - typescript - src\webparts\helloWorld\components\HelloWorld.tsx(6,25): error TS2694: Namespace 'React' has no exported[13:12:02] Error - typescript - src\webparts\helloWorld\components\HelloWorld.tsx(14,61): error TS2339: Property 'props' does not exist [13:12:02] Finished subtask 'tslint' after 12 s TypeScript error(s) occurred.
Sadly, I cannot reproduce your issue: These are the setting for my test:
Have you used any other settings?
aaah see the "problem"! I selected Office Fabric UI as addon (lowest available version (6.x.x) without the fluent ui template) and then it results in the errors the startpost
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
_____ _____ _____ _____ ______
|████▄\ |████▄\ /▄█████|█████|██████|
|█|█| __ |█|█| |█(___ |█|__)█|█|____ __
|████▀/█▄██▄|████▀/ \▀██▄|█████/|██████/▄▀
|█| |█▀ ▀█|█| ____)█|█| |█| >██<
|█| |█| |█|█| |█████/|█| |█| ▄▀/\▀▄
█████████████████████████████████████████████████████████
Generator: PnP Community SPFx Generator Author: Office 365 / SharePoint PnP Core Team Maintainers: Stefan Bauer Contributors: Chandani Prajapati, Magnus Danielson, Matthew Farrell, Bill Ayers, Vincent Biret, Sergei Sergeev, Paweł Hawrylak, Chris Kent, Alex Terentiev Version: 1.15.0
Based on @microsoft/generator-sharepoint version: 1.11.0
? Which baseline packages do you want to target for your component(s)? SharePoint 2019 onwards, including SharePoint Online ? Choose your framework - ReactJS ? Which libraries to include ? Office UI Fabric ? Office UI Fabric: Please choose a version: 6.x.x - Default ? Vetting Options ? Include pipeline configuration? None ? Test Framework
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the |
---------´ | SharePoint Client-side | ( _´U_ ) | Solution Generator |
/A\ '--------------------------'
| ~ |
'..'_
´ |° ´ Y
A component for the onprem19 environment will be created for you. Let's create a new SharePoint solution. ? What is your solution name? solution-pnpfx ? Where do you want to place the files? Use the current folder ? Do you want to allow the tenant admin the choice of being able to deploy the solution to all sites immediately without running any feature deployment or adding apps in sites? No ? Which type of client-side component to create? WebPart Add new Web part to solution solution-pnpfx. ? What is your Web part name? HelloWorld ? What is your Web part description? HelloWorld description
Thank you @bclevering - I dug some deeper into this and it seems like there is some hick-up in the questionary of the generator. I created the project again once with you settings and once without and added than Office UI Fabric 6 manually.
I got the following warnings:

The issue here is that you are only allowed to use Office UI Fabric version 5 because of the provided React version for SharePoint 2019 project.
It only supports:
- React: 15.6.2
- React-Dom: 15.6.2
For now to downgrade you can execute the following npm install:
npm install [email protected] [email protected] @types/[email protected] @types/[email protected] office-ui-fabric-react@5
Sorry for inconvenience it will be fixed in the next version.
I was able to resolve this by constraining the version of the @types/prop-types package in my package.json (I use Yarn for my package manager, which supports the resolutions section).
"resolutions": {
"@types/prop-types": "15.5.2"
}