yuusf
yuusf
DDeno
Created by yuusf on 11/8/2023 in #help
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.
6 replies