I wanted to use Photo Sphere Viewer in my project. So I ran
npm i photo-sphere-viewer
It appears to have downloaded the modules.
Then inside my project I did:
import PhotoSphereViewer from 'photo-sphere-viewer/dist/photo-sphere-viewer';
But I get 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 spot what is wrong?
PS. I think following line is causing issue (inside photo-sphere-viewer.js):
if (typeof define === 'function' && define.amd) {
define(['three', 'D.js', 'uevent', 'doT'], factory);
}
but I am even surprised why it enters inside this if
as I didn't know I had require.js
installed.
PPS. I have a react application created by create-react-app
Mine works with webpack using:
You can install with npm or yarn