Closed Otimkev closed 1 year ago
Hello @Otimkev As written in the readme, if you use Next.js you have to import the project in this way:
import './App.css';
import React, { useEffect, useRef } from 'react';
import dynamic from 'next/dynamic';
// import { ReactPhotoSphereViewer } from 'react-photo-sphere-viewer'; const ReactPhotoSphereViewer = dynamic( () => import('react-photo-sphere-viewer').then( (mod) => mod.ReactPhotoSphereViewer ), { ssr: false, } );
export default function Home() {
return (
); }
I suppose that the trouble is caused by this.
If you have any troubles, feel free to open the issue again.
Thanks.
`import { assign, spreadArray } from './node_modules/tslib/tslib.es6.js'; ^^^^^^
SyntaxError: Cannot use import statement outside a module at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1032:15) at Module._compile (node:internal/modules/cjs/loader:1067:27) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18)`
I get the above error in a Nextjs project.