sp-client-custom-fields icon indicating copy to clipboard operation
sp-client-custom-fields copied to clipboard

spfx 1.6.0 compatibility error (context field incompatible)

Open deanbot opened this issue 6 years ago • 3 comments

Greetings,

It looks like it's time to update @microsoft packages for 1.6.0 ("@microsoft/sp-webpart-base": "1.6.0") compatibility... IWebPartContext has changed.

Using PropertyFieldPicturePicker when i specify context i.e.:

PropertyFieldPicturePicker('id', {
...props,
context: this.context
})

I get the following error when serving.:

error TS2345: Argument of type '{ label: string; initialValue: string; readOnly: true; previewImage: true; allowedFileExtensions:...' is not assignable to parameter of type
'IPropertyFieldPicturePickerProps'.
[15:38:10] [tsc] Types of property 'context' are incompatible.
[15:38:10] [tsc] Type 'WebPartContext' is not assignable to type 'IWebPartContext'.[15:38:10] [tsc] Types of property 'httpClient' are incompatible.
[15:38:10] [tsc] Type 'HttpClient' is not assignable to type 'HttpClient'. Two different types with this name exist, but they are unrelated.
[15:38:10] [tsc] Types have separate declarations of a private property '_fetchProvider'.

deanbot avatar Sep 24 '18 21:09 deanbot

Same issue for the new released SPFx 1.7.0

berndverhofstadt avatar Dec 07 '18 14:12 berndverhofstadt

I found what I needed on the dev branch https://sharepoint.github.io/sp-dev-fx-property-controls/ npm i @pnp/spfx-property-controls@next -S

berndverhofstadt avatar Dec 13 '18 15:12 berndverhofstadt

@berndverhofstadt could you describe how you updated the package.json so it uses new references? I replaced package names and bumped versions but it was not good enough to make the linter happy.

rroa avatar Aug 30 '19 22:08 rroa