I was excited to incorporate Photo Sphere Viewer into my project. After running
npm i photo-sphere-viewer
I noticed that the modules were successfully downloaded.
Following that, I added this line inside my project:
import PhotoSphereViewer from 'photo-sphere-viewer/dist/photo-sphere-viewer';
Unfortunately, I encountered an 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
Could someone assist me in identifying the issue?
PS. From what I can tell, it seems like this line is causing trouble (inside photo-sphere-viewer.js):
if (typeof define === 'function' && define.amd) {
define(['three', 'D.js', 'uevent', 'doT'], factory);
}
Additionally, I am confused as to why it is entering this if
statement since I wasn't aware of having require.js
installed.
PPS. This is a react application generated using create-react-app
.