Newly created SPFx web part using react framework gives error with SharePoint online workbench while testing

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/288941

Вопрос

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.

Это было полезно?

Решение

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

Другие советы

This file type unsupported by office version

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top