yuusfY
Denoβ€’3y agoβ€’
5 replies
yuusf

External package code throws error: window is undefined

Hello,
I have imported an npm package to my project. And in this package's code, there is a condition:
if (typeof window === 'undefined') {
  throw new Error('Error initializing the sdk: window is undefined');
}

Program throws "window is undefined" error at this condition above.

I am able to access window object in my Deno project. Also, when I add a breakpoint to condition line in the cache folder files, I can access to window object from debug console as well.

It would be great if someone help me resolve this problem.

Thanks in advance.
Was this page helpful?