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');
}
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.
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
D
Deno
Chat about Deno, a modern runtime for JavaScript and TypeScript.