project-nv / night-vision

Highly customizable charting library, created for professional traders
https://nightvision.dev
MIT License
237 stars 54 forks source link

Lazy import hammer and hamster which access `window` #44

Closed Swoorup closed 1 year ago

Swoorup commented 1 year ago

Resolves browser access errors on server when SSR isn't enabled on that page for sveltekit projects.

Was getting, simply importing NightVision modules as previously simply importing like import { NightVision } from 'night-vision'; at the top of the project would try to access browser based functions

window is not defined
ReferenceError: window is not defined
    at /node_modules/night-vision/dist/night-vision.js:5092:6
    at /node_modules/night-vision/dist/night-vision.js:5093:3

Chart would still need to be initialized onMount.

netlify[bot] commented 1 year ago

Deploy Preview for shiny-selkie-5e063f canceled.

Name Link
Latest commit e28d4857ddc1acf34aa6cdbde110d7b0cb6c0f43
Latest deploy log https://app.netlify.com/sites/shiny-selkie-5e063f/deploys/63ba8eac5092de000a21d01f