Skip to content

containerSeemsToBeEmptyDomElement does not check correctly for lib.dom.d.ts #61466

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

Closed
frodi-karlsson opened this issue Mar 22, 2025 · 0 comments Β· Fixed by #61481
Closed

containerSeemsToBeEmptyDomElement does not check correctly for lib.dom.d.ts #61466

frodi-karlsson opened this issue Mar 22, 2025 · 0 comments Β· Fixed by #61481
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@frodi-karlsson
Copy link
Contributor

πŸ”Ž Search Terms

"compiler option to include", "containerSeemsToBeEmptyDomElement"

πŸ•— Version & Regression Information

  • This changed in commit 31374d2 when this diagnostic was added

⏯ Playground Link

https://github.com/frodi-karlsson/lib-dom-example

πŸ’» Code

// tsconfig.json
{
  "compilerOptions": {
    "target": "esnext",
    "lib": ["es5", "dom"],
    "noEmit": true
  },
  "files": ["index.ts"]
}
// index.ts
interface HTMLXYZElement {}

const a = {} as HTMLXYZElement;

// gives us Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom
// when it should give Property_0_does_not_exist_on_type_1
a.innerText = "hello";

πŸ™ Actual behavior

Property 'innerText' does not exist on type 'HTMLXYZElement'. Try changing the 'lib' compiler option to include 'dom'.

πŸ™‚ Expected behavior

Property 'innerText' does not exist on type 'HTMLXYZElement'.

Additional information about the issue

Bit of a duplicate of #54484 which did not have sufficient adherence to issue template. Noticed by @jakebailey here

There's a check for "dom" that should be "lib.dom.d.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants