Skip to content

jsdom 27.3.0 crashes on valid CSS due to @acemir/cssom regression #3997

@peritpatrio

Description

@peritpatrio

Node.js version

v24.8.0

jsdom version

27.3.0

Minimal reproduction case

const { JSDOM } = require("jsdom");

const options = {};
const dom = new JSDOM(`
<!DOCTYPE html>
<html>
<head>
<style>
    @layer x { .a { @media all { @media all { color: red } } } }
</style>
</head>
<body></body>
</html>
`, options);

console.log("PASS");

How does similar code behave in browsers?

This CSS is valid and works in all modern browsers.

What is the problem?

I expected this to parse successfully, like it does in browsers and in jsdom 27.2.0. Instead, it crashes with RangeError: Maximum call stack size exceeded in jsdom 27.3.0.

The issue is in the upstream dependency @acemir/cssom which was upgraded from ^0.9.23 to ^0.9.28 in jsdom 27.3.0. Filed: acemir/CSSOM#76

Metadata

Metadata

Assignees

No one assigned

    Labels

    csshas to-upstream testThis bug has a failing to-upstream web platform test waiting to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions