jarvisniu / vue-zoomer

Zoom the image or other thing with mouse or touch
MIT License
150 stars 37 forks source link

debounce.min.js causes "ReferenceError: window is not defined" from Vite SSG #37

Open J-Sek opened 2 years ago

J-Sek commented 2 years ago

I generate pages with vite-ssg@0.19.0. The process succeeds but the pages are not generated due to error. I have tried dynamic import, but it does not work either.

ReferenceError: window is not defined
    at file:///home/me/my-project/.vite-ssg-temp/main.mjs:2224:16

Points to:

// ...
}, Symbol.toStringTag, { value: "Module" }));
if (typeof global === "undefined")
  var global = window;
// ...

That can be found at the beginning of debounce.min.js.