We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
service worker
> JSON.stringify([typeof window, typeof Buffer, typeof btoa, typeof self, typeof self.btoa, typeof globalThis.btoa]) '["undefined","undefined","function","object","function","function"]'
Got Error.
Unsupported environment: window.btoa or Buffer should be supported
window.btoa
Buffer
service worker should be supported
The text was updated successfully, but these errors were encountered:
fix: use global btoa, support services worker, close #258
btoa
5eaedfe
@antfu
Given
node also have btoa
node
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/05094b6df4fb6f4404333725f13d63dd8aabeb34/types/node/buffer.d.ts#L2328-L2330
I suggest check Buffer first
if (typeof Buffer === "function") { // ... } else if (typeof btoa === "function") { // ... }
Sorry, something went wrong.
2dea20b
It still fails as this logic was not updated:
https://github.com/Rich-Harris/magic-string/blob/master/src/SourceMap.js#L3
No branches or pull requests
Env
service worker
Detail
Actual
Got Error.
Unsupported environment:
window.btoa
orBuffer
should be supportedExpected
service worker should be supported
The text was updated successfully, but these errors were encountered: