Open dhanraj-khatal opened 2 years ago
Seams to be an issue with react 17 - rather the dev/s of this package or a base package doing bad things with either state management or event listeners. Either that or it's a react version mismatch.
I downgraded react to 16 and everything worked.
npm install --save react@16.13.0 react-dom@16.13.0
Then importing with
const STLViewer = dynamic(() =>
import('../node_modules/react-stl-obj-viewer/build').then((mod) => mod.STLViewer),
{ ssr: false }
)
Because - not natively supporting SSR - the build process or one of the base libraries is using document without checking for its the existence first.
browser console showing the below error after stl file render index.js:52371