1

I have just created one SPFx web part with react framework. I tried testing through SharePoint online workbench (https://demo.sharepoint.com/sites/test/_layouts/15/workbench.aspx).

I am getting an error. Chrome browser developer tool shows below error:

Failed to load resource: the server responded with a status of 404 (Not Found)
https://localhost:4321/node_modules/react-dom/dist/react-dom.js
https://localhost:4321/node_modules/react/dist/react.js

Based on above mentioned error, I noticed the "node_modules/react/" does not contains "dist" folder at all.

4
  • Is it running properly on local workbench? make sure gulp serve is running properly and try hard refresh (Ctrl + F5) on SharePoint workbench once after gulp serve is running. which version of SPFx generator you are using? Commented Jan 18, 2021 at 11:49
  • Gulp serve is in running state. I am using @microsoft/[email protected] Commented Jan 18, 2021 at 12:45
  • Did you try running this web part in local workbench? Commented Jan 18, 2021 at 13:10
  • Yes Ganesh,I tried running the webpart in workbench. Actually the webpart is retriving one list data and displaying those over the form.Within the local workbench it does not show up those data as the sharepoint site it refers to provides forbidden error.this is fine. But when I am testing with SP Online site workbench where the actual list is present, there it throws mentioned two JS not found. I can see the data is getting retrieved through chrome browser console but not getting rendered due to the issue Commented Jan 18, 2021 at 13:26

2 Answers 2

0

Per my test, I could reproduce this issue on my end. It seems to be a bug that on SharePoint online workbench it tries to request node_modules/react-dom/dist/react-dom.js instead of the react library

enter image description here

0

This file type unsupported by office version

1
  • If so, how do I be able to test my react spfx webpart with sharepoint online workbench?Please can you guide? Commented Jan 18, 2021 at 12:47

Your Answer

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

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