You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thank you for providing this library.
We have recently starting experiencing an Uncaught DOMException: Failed to execute 'atob' on 'Window' on use of this library.
I think the meaning of use strict; (at least on chrome) has recently got a lot more strict and the use of the non-imported atob and btoa in this library is now causing an Uncaught DOMException.
As far as I can see, replacing atob and btoa with window.atob and window.btoa makes things work again but I'm uncertain as to whether this is the correct approach.
Well that commit should only change the tests - so I'm not certain that would affect things.
Whilst I've posited above that I think this is probably something to do with the browser tightening the meaning of use strict;, we in go-gitea/gitea might be being affected because of some tightening within our webpack configuration or webpack itself. I just don't know and don't know where to look. I do know that using window.atob and window.btoa fixes this for us.
I find working with the javascript ecosystem infuriating like this because to me it's completely opaque as to where the problem is and what has changed to make this problem appear.
atob and btoa are standard on Web and not going anywhere due backward compatibility the Web is famous for … I’ve no idea which environment you’re after but from JS perspective window.atob or just atob are the same. Moreover, there are environments where window doesn’t exist (Workers) and self.atob or atob is still the same.
Activity
yardenshoham commentedon Jan 29, 2023
Probably because of ff5c87d
zeripath commentedon Jan 29, 2023
Well that commit should only change the tests - so I'm not certain that would affect things.
Whilst I've posited above that I think this is probably something to do with the browser tightening the meaning of
use strict;
, we in go-gitea/gitea might be being affected because of some tightening within our webpack configuration or webpack itself. I just don't know and don't know where to look. I do know that usingwindow.atob
andwindow.btoa
fixes this for us.I find working with the javascript ecosystem infuriating like this because to me it's completely opaque as to where the problem is and what has changed to make this problem appear.
WebReflection commentedon Jan 29, 2023
atob and btoa are standard on Web and not going anywhere due backward compatibility the Web is famous for … I’ve no idea which environment you’re after but from JS perspective window.atob or just atob are the same. Moreover, there are environments where window doesn’t exist (Workers) and self.atob or atob is still the same.
in short, you have an issue with your environment
zeripath commentedon Jan 29, 2023
Hmm looks like I was experiencing some kind of weird different bug - which might have been temporary.
WebReflection commentedon Jan 30, 2023
I guess we can close this then