Autodesk Forge Viewer in Sharepoint only shows black model
P粉265724930
2023-09-02 20:17:59
<p>For our current project, we followed this tutorial to integrate Forge Viewer into Sharepoint. (https://aps.autodesk.com/blog/sharepoint-online-integration)</p>
<p>Then we set up the project in React using this npm package.
https://www.npmjs.com/package/react-forge-viewer. </p>
<p>After migrating the project to React, the viewer lost all color and turned black. </p>
<p>According to the error message, the property is still undefined when the viewer is loaded.
This problem did not occur when using only SPFX, only after using React. </p>
<p>Thank you very much for your help! </p>
<p>Error message</p>
<p>Colorless Viewer</p>
Looks like the (community developed) react-forge-viewer project has not been updated in the past 3 years. To rule out any issues in this project, I recommend replacing it with your own simple React wrapper. Something like the following:
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.css">
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.js"></script>
<Viewer />
component into your application.If the problem persists even with this simple React component, try using the component in a standalone React application to rule out any potential issues introduced by the Sharepoint environment.