question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundling with rollup - Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new'

See original GitHub issue

Description

Bundling with rollup - Uncaught TypeError: Class constructor LitElement cannot be invoked without ‘new’

Live Demo

https://github.com/johnlim/my-element.git

Steps to Reproduce

  1. Clone the repo
  2. npm install
  3. ./node_modules/.bin rollup -c
  4. Serve index.html
  5. console error Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new'

Expected Results

Custom lit-element should be rendered

Actual Results

Console error Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new'

Browsers Affected

  • [ *] Chrome
  • Firefox
  • Edge
  • Safari 11
  • Safari 10
  • IE 11

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
johnlimcommented, Jul 13, 2018

@Noooil Thanks! That works!

0reactions
patrickkuhlmanncommented, Jul 12, 2018

inline your babelrc into rollup.config.js like this

babel({
    // babelrc: false is needed to prevent reading broken .babelrc files from
    // dependencies (we have to process node_modules). Thats why we also need
    // to inline our own .babelrc file
    babelrc: false,
    presets: [["@babel/es2015", { modules: false }]]
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Class constructor LitElement cannot ...
Description Bundling with rollup - Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new' Live Demo ...
Read more >
How to fix `Class constructor LitElement cannot be invoked ...
Based on others suggestion I have tried setting tsconfig target to "es2016" but this does not solve the error. my-element.ts import { LitElement ......
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 >
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 >
Feb 28, 2019
When using parceljs I get this error: Uncaught TypeError: Class constructor LitElement cannot be invoked without 'new' I can't get Polymer CLI to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found