1

I have created a carousel using SPFx web part with react. My react version is 15.6.2 and solution selected is SharePoint 2019 onwards, including SharePoint online.

I need to display Thumbnail images which are supported only by latest versions of react (v16 and above). Upgrading to latest version fails to load my workbench displaying below errors in console.

***Failed to load component "fe735b47-53a5-4b5f-98ae-6ce4c3d2fce0" (HelloWorldWebPart). Original error: ***Failed to load URL 'https://localhost:4321/node_modules/react/dist/react.js' for resource 'react' in component 'fe735b47-53a5-4b5f-98ae-6ce4c3d2fce0' (HelloWorldWebPart). The file was not found in the server. Make sure that you are running 'gulp serve'.

Old versions does not support thumbnails.

I have tried multiple approaches of displaying thumbnail images below carousel but all require latest version of react. Is there any solution to this ?

2 Answers 2

2

As per official documentation by Microsoft,

SharePoint 2019 supports SharePoint Framework client-side web parts hosted on classic or modern SharePoint pages built by using the SharePoint Framework v1.4.1. SharePoint 2019 also supports SharePoint Framework extensions hosted on modern SharePoint pages built using SharePoint Framework v1.4.1. This means that when you are targeting the SharePoint 2019 platform, you need to use the SharePoint Framework v1.4.1 due to the server-side version dependencies.

Try using SharePoint Framework v1.4.1 and check if it works for you.

0

Can you check your SPFX Version in your project? In the package.json file, check the version of the @microsoft/sp-core-library package. According to this link SPFX 1.11.0 should work with React version 16.8.5

3
  • My Spfx version is 1.11.0 but still it does not work. Configuration is as follows. @microsoft/[email protected] +-- [email protected] +-- [email protected] `-- [email protected] Package.json shows "@microsoft/sp-core-library": "~1.4.0". I think it is not supported with SharePoint 2019 solution.
    – Varsha
    Oct 5, 2020 at 7:09
  • When tried to create a solution selecting- SharePoint Online only(Latest) It worked because it automatically added latest version of react. I think it does not work only with SharePoint on premise solution.
    – Varsha
    Oct 8, 2020 at 5:09
  • Yes your right. In the Link I provided it says that SharePoint Online always uses the latest version of the SharePoint Framework, but SharePoint 2016 and SharePoint 2019 only support the versions that match the server-side dependencies of the deployed packages. SharePoint 2019 supports v1.4.1 or lower which means react v15.x is supported. I only created SharePoint Online solutions so far, so I learned something new today :-D
    – Sandro
    Oct 8, 2020 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.