Javascript library launch problem (photo viewer)
I wanted to use Photo Sphere Viewer in my project. So I ran
npm i photo-sphere-viewer
Seems to have loaded the modules.
Then in my project I did:
import PhotoSphereViewer from 'photo-sphere-viewer/dist/photo-sphere-viewer';
But I am getting error:
Failed to compile.
Error in ./~/photo-sphere-viewer/dist/photo-sphere-viewer.js
Module not found: 'D.js' in /home/ghy/WebstormProjects/mia-map/node_modules/photo-sphere-viewer/dist
@ ./~/photo-sphere-viewer/dist/photo-sphere-viewer.js 9:4-55
Can anyone help me determine what is wrong?
PS. I think the following line is causing the problem (inside photo-sphere-viewer.js):
if (typeof define === 'function' && define.amd) {
define(['three', 'D.js', 'uevent', 'doT'], factory);
}
but I'm even surprised why it gets inside this if
as I didn't know what I had installed require.js
.
PPS. I have a react app created bycreate-react-app
+3
source to share
No one has answered this question yet
Check out similar questions: