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

queueMicrotask is not a function #959

Closed
loreanvictor opened this issue Jul 2, 2023 · 1 comment · Fixed by #981
Closed

queueMicrotask is not a function #959

loreanvictor opened this issue Jul 2, 2023 · 1 comment · Fixed by #981
Assignees
Labels
bug Something isn't working

Comments

@loreanvictor
Copy link

Describe the bug
window.queueMicrotask is undefined, causing issues with running some custom components that use the functionality.

To Reproduce
Run the following code (sandbox):

import { Window } from "happy-dom";
import { JSDOM } from "jsdom";

const jsdwindow = new JSDOM().window;
const happywindow = new Window();

console.log(jsdwindow.queueMicrotask);
console.log(happywindow.queueMicrotask);

Expected behavior
window.queueMicrotask exists and behaves according to specification (or perhaps a rough proxy of it, e.g. cb => Promise.resolve().then(cb), is enough for most use cases that happy dom is to cover?)

Additional context
I am unsure if this should be considered a feature request or a bug. Currently I listed this as a bug since happy-dom aims to be useful for testing and server-side rendering of custom elements, but lacking this feature means it cannot run custom elements relying on the functionality (that's how I encountered the issue actually).

@loreanvictor loreanvictor added the bug Something isn't working label Jul 2, 2023
@capricorn86 capricorn86 self-assigned this Jul 12, 2023
@capricorn86 capricorn86 linked a pull request Jul 12, 2023 that will close this issue
capricorn86 added a commit that referenced this issue Jul 12, 2023
…ot-a-function

#959@minor: Adds support for Window.queueMicrotask.
@capricorn86
Copy link
Owner

Thank you for reporting @loreanvictor! 🙂

There is a fix out now.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v10.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants