SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

SPFx 1.19.0 - custom dialog #9874

Open stevedDev opened 1 month ago

stevedDev commented 1 month ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

πŸ’₯ SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

Additional environment details

Describe the bug / error

I was getting the exact same problem as reported in issue #8895 i.e. the image, but applying the "fix" of limiting the project to react 17.0.1 (I did notice that it had included 17.0.2 by default): npm i react@17.0.1 react-dom@17.0.1 @types/react@17.0.45 @types/react-dom@17.0.17 --save-exact

That went away but is now replaced by a somewhat bigger issue of: image when running under gulp serve, which seems to prevent the loading of the component entirely.

If I actually package the solution up and drop it into appcatalog, which is actioned without error, I actually get an error trying to add the app onto my SharePoint site: image

I replicated the exact same issue creating a fresh SPFx 1.19 project and added the ColorPickerDialog.tsx custom dialog as per the Microsoft Learn page (just running the save-exact install of react 17.0.1 etc manually).

Steps to reproduce

  1. Create new SPFx 1.19.0 app
  2. Fix to use react-17.0.1
  3. Add ColorPickerDialog code from Learn site
  4. Deploy via gulp serve against a library

Expected behavior

Button shown on library and dialog shown when clicked.

stevedDev commented 1 month ago

Actually looks like its been raised in #9776 as well