Skip to content
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

Change Blob.prototype to global.Blob.prototype #13

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

tmisirpash
Copy link

When using Webpack's ProvidePlugin to shim all instances of Blob in the bundle with this polyfill, Webpack will generate a var declaration that looks something like like this:

var Blob = __webpack_require__(203)["Blob"];

// The rest of this polyfill
(function(global)) {

}

If there is already a globally defined Blob, global.Blob will not necessarily be the same as just Blob. The exact error we are seeing is TypeError: Cannot read properties of undefined (reading 'prototype') (which indicates that in this case, Blob is undefined.) We are hitting this because we'd like to start providing Blob as a server-side runtime API, but clients may still be polyfilling with the ProvidePlugin.

@bjornstar bjornstar merged commit 53d1119 into bjornstar:master Jun 30, 2024
4 checks passed
@bjornstar
Copy link
Owner

Thanks, I'll get this published.

@bjornstar
Copy link
Owner

Released in v8.0.20240630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants