質問

I am encountering the below error and would welcome any information to resolve the issue:

  • SharePoint 2019
  • SPFx webpart with No Javascript Framework
  • PropertyPaneFieldType'.\n Property 'DynamicField' is missing in type 'import
  • getPropertyPaneConfiguration' in type 'OrderformpnpWebPart' is not assignable to the same property in base type 'BaseClientSideWebPart'
       {
                "resource": "/c:/code/OrderFormPNP/src/webparts/orderformpnp/OrderformpnpWebPart.ts",
                "owner": "typescript",
                "code": "2416",
                "severity": 8,
                "message": "Property 'getPropertyPaneConfiguration' in type 'OrderformpnpWebPart' is not assignable to the same property in base type 'BaseClientSideWebPart<IOrderformpnpWebPartProps>'.\n  Type '() => import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneConfiguration' is not assignable to type '() => import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPane/IPropertyPane\").IPropertyPaneConfiguration'.\n    Call signature return types 'IPropertyPaneConfiguration' and 'IPropertyPaneConfiguration' are incompatible.\n      The types of 'pages' are incompatible between these types.\n        Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPanePage[]' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPanePage/IPropertyPanePage\").IPropertyPanePage[]'.\n          Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPanePage' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPanePage/IPropertyPanePage\").IPropertyPanePage'.\n            Types of property 'groups' are incompatible.\n              Type '(IPropertyPaneGroup | IPropertyPaneConditionalGroup)[]' is not assignable to type 'IPropertyPaneGroup[]'.\n                Type 'IPropertyPaneGroup | IPropertyPaneConditionalGroup' is not assignable to type 'IPropertyPaneGroup'.\n                  Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneGroup' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneGroup/IPropertyPaneGroup\").IPropertyPaneGroup'.\n                    Types of property 'groupFields' are incompatible.\n                      Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneField<any>[]' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").IPropertyPaneField<any>[]'.\n                        Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneField<any>' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").IPropertyPaneField<any>'.\n                          Types of property 'type' are incompatible.\n                            Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").PropertyPaneFieldType' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").PropertyPaneFieldType'.\n                              Property 'DynamicField' is missing in type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").PropertyPaneFieldType'.",
                "source": "ts",
                "startLineNumber": 170,
                "startColumn": 13,
                "endLineNumber": 170,
                "endColumn": 41
            }
        
        
            import { Version } from '@microsoft/sp-core-library';
            import {
              IPropertyPaneConfiguration,
              PropertyPaneTextField
            } from '@microsoft/sp-property-pane';
            import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
            import { escape } from '@microsoft/sp-lodash-subset';
            import * as $ from 'jquery';
            import styles from './OrderformpnpWebPart.module.scss';
            import * as strings from 'OrderformpnpWebPartStrings';
            import { sp, Web, IWeb } from "@pnp/sp/presets/all";
            import "@pnp/sp/lists";
            import "@pnp/sp/items";
            
            -
            -
            -
            protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
              return {
                pages: [
                  {
                    header: {
                      description: strings.PropertyPaneDescription
                    },
                    groups: [
                      {
                        groupName: strings.BasicGroupName,
                        groupFields: [
                          PropertyPaneTextField('description', {
                            label: strings.DescriptionFieldLabel
                          })
                        ]
                      }
                    ]
                  }
                ]
              };
            }
            }

 {
                "resource": "/c:/code/OrderFormPNP/src/webparts/orderformpnp/OrderformpnpWebPart.ts",
                "owner": "typescript",
                "code": "2416",
                "severity": 8,
                "message": "Property 'getPropertyPaneConfiguration' in type 'OrderformpnpWebPart' is not assignable to the same property in base type 'BaseClientSideWebPart<IOrderformpnpWebPartProps>'.\n  Type '() => import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneConfiguration' is not assignable to type '() => import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPane/IPropertyPane\").IPropertyPaneConfiguration'.\n    Call signature return types 'IPropertyPaneConfiguration' and 'IPropertyPaneConfiguration' are incompatible.\n      The types of 'pages' are incompatible between these types.\n        Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPanePage[]' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPanePage/IPropertyPanePage\").IPropertyPanePage[]'.\n          Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPanePage' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPanePage/IPropertyPanePage\").IPropertyPanePage'.\n            Types of property 'groups' are incompatible.\n              Type '(IPropertyPaneGroup | IPropertyPaneConditionalGroup)[]' is not assignable to type 'IPropertyPaneGroup[]'.\n                Type 'IPropertyPaneGroup | IPropertyPaneConditionalGroup' is not assignable to type 'IPropertyPaneGroup'.\n                  Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneGroup' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneGroup/IPropertyPaneGroup\").IPropertyPaneGroup'.\n                    Types of property 'groupFields' are incompatible.\n                      Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneField<any>[]' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").IPropertyPaneField<any>[]'.\n                        Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").IPropertyPaneField<any>' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").IPropertyPaneField<any>'.\n                          Types of property 'type' are incompatible.\n                            Type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-property-pane/dist/index-internal\").PropertyPaneFieldType' is not assignable to type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").PropertyPaneFieldType'.\n                              Property 'DynamicField' is missing in type 'import(\"c:/code/OrderFormPNP/node_modules/@microsoft/sp-webpart-base/lib/propertyPane/propertyPaneFields/propertyPaneField/IPropertyPaneField\").PropertyPaneFieldType'.",
                "source": "ts",
                "startLineNumber": 170,
                "startColumn": 13,
                "endLineNumber": 170,
                "endColumn": 41
            }
役に立ちましたか?

解決

Samuel,

From the error, it looks like you may be trying to use Dynamic properties.

Dynamic properties were introduced in SPFx 1.7, unfortunately SharePoint 2019 only supports up to SPFx 1.4.1.

I know it probably isn't the answer you were hoping for, but is explains the errors you're getting.

Let us know if we can help you in any other way?

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top