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: XMLHttpRequest is not defined #463

Closed
Tracked by #520
sschneider-ihre-pvs opened this issue May 2, 2022 · 3 comments
Closed
Tracked by #520

ReferenceError: XMLHttpRequest is not defined #463

sschneider-ihre-pvs opened this issue May 2, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@sschneider-ihre-pvs
Copy link

sschneider-ihre-pvs commented May 2, 2022

I try to use happy-dom jest env in a quasar project and am facing this error when jest hits the line with

import { installQuasarPlugin } from '@quasar/quasar-app-extension-testing-unit-jest';

stack trace

      at Object.<anonymous> (node_modules/quasar/dist/quasar.esm.prod.js:6:22776)
      at Object.<anonymous> (node_modules/@quasar/quasar-app-extension-testing-unit-jest/src/helpers/install-quasar-plugin.ts:4:1)
      at Object.<anonymous> (node_modules/@quasar/quasar-app-extension-testing-unit-jest/src/helpers/index.ts:1:1)

My guess, this is not used but has a reference in the dist file.

@MarkLyck
Copy link

MarkLyck commented May 4, 2022

I have a similar problem with using the logrocket package.

ReferenceError: XMLHttpRequest is not defined
 ❯ new e evalmachine.<anonymous>:1:77916
 ❯ script.onload node_modules/.pnpm/logrocket@2.2.1/node_modules/logrocket/dist/build.umd.js:3641:27
    3639|       // causing _LRlogger to be undefined.  Let's make sure its there first.
    3640|       if (typeof window._LRLogger === 'function') {
    3641|         instance.onLogger(new window._LRLogger({
       |                           ^
    3642|           sdkVersion: sdkVersion
    3643|         }));

Even though it doesn't get used, just importing the package tries to use XMLHttpRequest

@capricorn86 capricorn86 added the enhancement New feature or request label Jun 14, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Jun 25, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Jun 26, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Jun 26, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Jun 26, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Jun 28, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Oct 16, 2022
capricorn86 pushed a commit to Mas0nShi/happy-dom that referenced this issue Oct 18, 2022
…fault and improves the functionality of XMLHttpRequest.
capricorn86 added a commit to Mas0nShi/happy-dom that referenced this issue Oct 18, 2022
capricorn86 pushed a commit to Mas0nShi/happy-dom that referenced this issue Oct 26, 2022
capricorn86 added a commit that referenced this issue Dec 7, 2022
…equest

#463@minor: Adds support for XMLHttpRequest.
@capricorn86
Copy link
Owner

Thanks for reporting @sschneider-ihre-pvs! 🙂

We have now added support for XMLHttpRequest.

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

@capricorn86 capricorn86 self-assigned this Dec 7, 2022
@sschneider-ihre-pvs
Copy link
Author

he hey, some xmas gifts come early :D

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

No branches or pull requests

3 participants