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

ReferenceError: HTMLSelectElement is not defined #664

Closed
RettentoRectangle opened this issue Nov 23, 2022 · 3 comments · Fixed by #676
Closed

ReferenceError: HTMLSelectElement is not defined #664

RettentoRectangle opened this issue Nov 23, 2022 · 3 comments · Fixed by #676
Assignees
Labels
bug Something isn't working

Comments

@RettentoRectangle
Copy link

Describe the bug
HTMLSelectElement import is missing from index.ts

To Reproduce
const el = document.createElement('select')

const isSelect = el instanceof HTMLSelectElement // <- ReferenceError: HTMLSelectElement is not defined

Expected behavior
HTMLSelectElement is part of the globals

Additional context
Switching from JSDOM to happy-dom

@RettentoRectangle RettentoRectangle added the bug Something isn't working label Nov 23, 2022
@RettentoRectangle
Copy link
Author

RettentoRectangle commented Nov 23, 2022

// happy-dom/packages/happy-dom/src/index.ts
import HTMLSelectElement from './nodes/html-select-element/HTMLSelectElement';
import IHTMLSelectElement from './nodes/html-select-element/IHTMLSelectElement';

export {
...
HTMLSelectElement,
IHTMLSelectElement,
...
}

Thank you!

Some of our tests are broken after switched from JSDOM to happy-dom.

I got some other errors (and solutions), but easy wins first. :)

@capricorn86 capricorn86 self-assigned this Dec 7, 2022
capricorn86 added a commit that referenced this issue Dec 7, 2022
capricorn86 added a commit that referenced this issue Dec 7, 2022
…selectelement-is-not-defined

#664@patch: Adds the property window.HTMLSelectElement, so that it wi…
@capricorn86 capricorn86 reopened this Dec 8, 2022
@capricorn86
Copy link
Owner

Re-opening. Wrong import.

Schleuse pushed a commit to Schleuse/happy-dom that referenced this issue Dec 20, 2022
capricorn86 added a commit that referenced this issue Dec 20, 2022
#664@patch: Fixes error due to typo in import path.
@capricorn86
Copy link
Owner

Sorry for taking so long @RettentoRectangle! 😅

It has finally been fixed.

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

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