Skip to content

Conversation

@upupming
Copy link
Contributor

Recently, we changed our repository's package manager from yarn to npm (fc60d50), which caused our typescript version to change from 5.4.5 to 5.8.2, because we specified the version in package.json with "typescript": "^5.4.5". Under 5.8.2, an error will be reported here, and tsc --noEmit will fail.

$ npx tsc --noEmit 
src/adapter/dom.ts:4:68 - error TS2322: Type 'Element | Text' is not assignable to type 'Element'.
  Type 'Text' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 116 more.

4  return dom.nodeType === NodeType.Text ? (dom.parentNode as any) : dom;
                                                                     ~~~


Found 1 error in src/adapter/dom.ts:4

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@marvinhagemeister marvinhagemeister merged commit afe0bd6 into preactjs:main Jul 28, 2025
1 check passed
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.

2 participants