Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new'
See original GitHub issueI’m trying out Lit Element in a vanilla Angular 6 project and running into Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new'
when trying out the hello world lit element example. This commit shows how I added webcomponentjs / litelement packages, allow custom schema in angular, declare the my-element LitElement example, and then use that element in the app. That commit was made right after running the ng new
command.

If you want to poke at it, run the following commands…
git clone https://github.com/rjsteinert/angular-with-lit-element.git
cd angular-with-list-element
npm install
npm start
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:55 (20 by maintainers)
Top Results From Across the Web
Class constructor LitElement cannot be invoked without 'new ...
I'm trying out Lit Element in a vanilla Angular 6 project and running into Uncaught TypeError: Class constructor LitElement cannot be ...
Read more >How to fix `Class constructor LitElement cannot be invoked ...
After struggling with it for a while, it seems parcel (as of v1.12.3) has an issue where it doesn't consider the browserslist unless ......
Read more >TypeError: Class constructor HTMLElement cannot be invoked ...
This error occurs while running a unit test. The component that you are running has probably some 3rd party code which contains class...
Read more >Class constructor cannot be invoked without 'new' in TS
The "Class constructor cannot be invoked without new" error occurs when the target property in tsconfig.json is set to lower than es6 or...
Read more >class constructor cannot be invoked without 'new'
Class constructor LitElement cannot be invoked without 'new' Class constructor PolymerElement cannot be invoked without 'new' 7.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To anyone else that ends up here, lit-element is distributed as es2015 so you must transpile it to es5 as part of your build process. If you’re using Webpack add the following to your JavaScript rule:
Hey @rjsteinert,
do you need it to be downtranspiled to ES5? I changed my
tsconfig.json
to targetES2015
and then using the polyfill without the adapter works. You can see an example here: https://github.com/dkundel/vote-my-talk/commit/8b7f29a2993076b05582914b594b9500d67d919bCheeers, Dominik