question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blob is not instance of Blob

See original GitHub issue

It appears that Blob is not an instance of Blob. Here’s a minimal repro on StackBlitz using Vitest: https://stackblitz.com/edit/happy-dom-bug-blob-prototype?file=README.md

This caused the following error when using the @web-std/file package after upgrading from vitest@0.11.0 to vitest@0.12.0

TypeError: Class extends value does not have valid prototype property undefined Object.<anonymous> node_modules/@web-std/file/dist/src/file.cjs:59:15 Object.<anonymous> node_modules/@web-std/file/dist/src/lib.node.cjs:6:12

I’m not sure if there’s also a bug in Vitest or not, but the fact that Blob.prototype is undefined appears to be the root cause. The error only occurs when using the happy-dom environment, so I believe this is the appropriate place to open an issue.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
davidortner-ipexcommented, Oct 11, 2022

I am continuing the work in #520 right now where we will replace the Happy DOM URL with Nodes version of it. Hopefully that will solve this issue then.

1reaction
capricorn86commented, May 20, 2022

@nakleiderer this should be solved in the latest version of Vitest 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check if a variable is a blob in JavaScript
You can test if it is an instanceof Blob like this: var MyBlob = new Blob(['test text'], {type : 'text/plain'}); document.body.innerHTML = MyBlob...
Read more >
Blob - Web APIs - MDN Web Docs - Mozilla
The Blob object represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary...
Read more >
Blobs in JavaScript - Mastering JS
Blobs (binary large objects) are a file-like data structure in JavaScript. Like buffers, but for the client side.
Read more >
ReferenceError: Blob is not defined in JavaScript | bobbyhadz
The "Blob is not defined" error occurs when the Blob class is used without being imported in a Node.js application. To solve the...
Read more >
What are Blobs used for in JavaScript? | by <Andrew Rymaruk />
Blob means “Binary Large Object” and it's an opaque representation of a chunk of bytes. Web Browsers implement a Blob object, which is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found