-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: window is not defined [CDN] #91
Comments
I have never used what you are using :( maybe write var window = {}; before loading UPNG.js |
I am trying to load it inside the worker using If only there was a check in the code if |
But are you sure that then, UPNG.js will work inside a worker? You could rewrite UPNG.js manually in a notepad. |
Yes, it works if I download this code - |
I made UPNG.js to be used in a web browser. Maybe ask that guy to make you a version that works in your environment? |
You see, if I download directly from https://github.com/photopea/UPNG.js/blob/master/UPNG.js it works fine, too. The problem is with that extra code that is added to the version that is hosted on CDN. I just wanted to use your code (and thank you so much for your work) from jsdeliver, because I already use other scripts from there. |
I got this error while trying to use it in non-window environment from jsdelivr:
ReferenceError: window is not defined
Any tips on how to use it from jsdelivr?
The file I am trying to use:
https://cdn.jsdelivr.net/npm/[email protected]/UPNG.min.js
But even this file:
https://cdn.jsdelivr.net/npm/[email protected]/UPNG.js
contains
else {window.UPNG = UPNG;}
and I do not understand why, because source code does not contain that code :/The text was updated successfully, but these errors were encountered: