Skip to content

Issues with Node 25 #1950

@dodomorandi

Description

@dodomorandi

Describe the bug
The probject experiences strange issues with Node 25. The testing environment throws an assertion and when using happy-dom as a testing environment the localStorage is an empty object.

To Reproduce
Steps to reproduce the behavior in relationship to the project itself:

  1. Install and use Node 25 (nvm can be handy)
  2. Clone the repo
  3. npm install
  4. npm run test

Expected behavior
Tests run and pass. This works flawlessly with Node 24.

Screenshots
Image

To Reproduce (2)
Steps to reproduce the (probably related) issue about localStorage from an external project:

  1. Install and use Node 25
  2. Create a dummy project installing vitest and happy-dom
  3. Create the following test file:
    // @vitest-environment happy-dom
    
    import { describe,it } from 'vitest';
    
    describe("test", () => {
      it("breaks localStorage", () => {
        window.localStorage.getItem("hello");
      })
    })
  4. Run npx vitest

Expected behavior
Tests run and pass, works with Node 24

Screenshots

Image

Device:

  • OS: Arch Linux
  • Node 25.1.0

Additional context
I cannot be sure the two noticed behavior are directly correlated, I only supposed so. If you realize the two problems are separated issues just let me know and I will split this specific issue in two.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions