Typescript: Error TS2339 with Shadow Dom

Created on 9 Oct 2017  路  4Comments  路  Source: microsoft/TypeScript

TypeScript Version: 2.5.3
Code:

let tmpl = document.querySelector('template'),
  host = document.getElementById('host-container');

let myRoot = host.createShadowRoot();

myRoot.appendChild(document.importNode(tmpl.content, true));

console:
: error TS2339: Property 'createShadowRoot' does not exist on type 'HTMLElement'.

when i change main.ts >> main.js
Everything works fine, that's reason why i make this topic.

_Maybe i did something wrong, so don't judge too hard :smile:_

Duplicate

All 4 comments

Duplicate of #10401

The Shadow DOM currently has limited browser support, therefore it not included in the libraries included with TypeScript. You will either have to create them yourself or acquire them somewhere.

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

What's your threshold for browser support that merits inclusion?

We have lowered the bar recently to allow experimental APIs. That said I am hoping that we would get this for free the next time we update our drop of the edge鈥檚 webidl

Was this page helpful?
0 / 5 - 0 ratings

Related issues

manekinekko picture manekinekko  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments

Roam-Cooper picture Roam-Cooper  路  3Comments

jbondc picture jbondc  路  3Comments

weswigham picture weswigham  路  3Comments