You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get caught TypeError: pannellum__WEBPACK_IMPORTED_MODULE_1__.viewer is not a function error
I have tried several alternatives, like const viewer = new pannellum.viewer(pannellumContainer.current, { and I getcaught TypeError: pannellum__WEBPACK_IMPORTED_MODULE_1__.viewer is not a constructor error
I tried replacing viewer with Viewer, same errors reffering to Viewer
I tried importing like so import { Viewer } from 'pannellum' and then using it like so const viewer = Viewer(pannellumContainer.current, { I get the same caught TypeError: (0 , pannellum__WEBPACK_IMPORTED_MODULE_1__.Viewer) is not a function error
I also tried using useRef to set Viewer like so : import it import { Viewer } from 'pannellum', set useRef const v = useRef(null); and in the useEffect v.current = new Viewer(pannellumContainer.current, { and I get the caught TypeError: pannellum__WEBPACK_IMPORTED_MODULE_1__.Viewer is not a constructor error
How can I fix this?
The text was updated successfully, but these errors were encountered:
Pannellum isn't an ES6 module, so you can't import it like one. You can either use a <script> tag, as is used in all of the examples, or use import 'pannellum'; (or you might need import 'pannellum.js'; or import 'path/to/pannellum.js';, depending on how you have things set up).
I want to use pannellum 2.5.6 inside react 18.2.0. Here is my code so far
I get
caught TypeError: pannellum__WEBPACK_IMPORTED_MODULE_1__.viewer is not a function
errorI have tried several alternatives, like
const viewer = new pannellum.viewer(pannellumContainer.current, {
and I getcaught TypeError: pannellum__WEBPACK_IMPORTED_MODULE_1__.viewer is not a constructor
errorI tried replacing viewer with Viewer, same errors reffering to Viewer
I tried importing like so
import { Viewer } from 'pannellum'
and then using it like soconst viewer = Viewer(pannellumContainer.current, {
I get the samecaught TypeError: (0 , pannellum__WEBPACK_IMPORTED_MODULE_1__.Viewer) is not a function
errorI also tried using useRef to set Viewer like so : import it
import { Viewer } from 'pannellum'
, set useRefconst v = useRef(null);
and in the useEffectv.current = new Viewer(pannellumContainer.current, {
and I get thecaught TypeError: pannellum__WEBPACK_IMPORTED_MODULE_1__.Viewer is not a constructor
errorHow can I fix this?
The text was updated successfully, but these errors were encountered: