Skip to content

Remove xpath dependency and add jsdom overrides for cssstyle version …#70

Merged
azhong-git merged 1 commit intomainfrom
remove-xpath-jsdom
Apr 7, 2026
Merged

Remove xpath dependency and add jsdom overrides for cssstyle version …#70
azhong-git merged 1 commit intomainfrom
remove-xpath-jsdom

Conversation

@azhong-git
Copy link
Copy Markdown
Contributor

…in package.json

	ERROR	error extracting main html Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/@csstools/css-calc/dist/index.mjs from /var/task/node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs not supported.
Instead change the require of /var/task/node_modules/@csstools/css-calc/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/var/task/node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs:30:24) {
  code: 'ERR_REQUIRE_ESM'
}

jsdom 24 specifies cssstyle: "^4.0.1", and npm resolved it to 4.6.0 which pulls in the ESM chain. The ^ semver range let the bad version slip in. This happens both locally and in prod.

The fix is to add an npm override to pin cssstyle to ~4.1.0 (the last version before @asamuzakjp/css-color was added in 4.2.0):

@azhong-git azhong-git temporarily deployed to integration-tests April 7, 2026 05:06 — with GitHub Actions Inactive
@azhong-git azhong-git merged commit 6633d36 into main Apr 7, 2026
5 checks passed
@azhong-git azhong-git deleted the remove-xpath-jsdom branch April 7, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant