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.

Uncaught TypeError: Illegal constructor Error

See original GitHub issue

Hi,

I am getting this error:

Uncaught TypeError: Illegal constructor
    at n (prism.js:1)
    at prism.js:1
    at prism.js:1
    at Array.forEach (<anonymous>)
    at Prism.plugins.toolbar.hook (prism.js:1)
    at Object.run (prism.js:1)
    at Object.highlightElement (prism.js:1)
    at HTMLDocument.highlightAll (prism.js:1)

It seems to be showing when I add the “Copy to Clipboard Button” package.

My browser I am getting the error is Google Chrome Version 62.0.3200.0 (Official Build)

Here is a screenshot of the error in dev tools:

untitled

For now I am just going to live with out adding this plugin. I thought I’d let you know anyway.

p.s. Normal setup works fine no problem. It only appears with this plugin addon.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
mAAdhaTTahcommented, Oct 13, 2017

This version of the fix is here: #1206.

2reactions
mAAdhaTTahcommented, Sep 12, 2017

@caraya Thanks, that might be it, but Chrome 61 (or 63) doesn’t have a navigator.clipboard property. I’m still not sure the cause.

Update: Yes, the window.Clipboard prototype matches the Clipboard inteface in the spec, so this must be an early introduction as they build out the infra for this Clipboard api.

Just so everyone knows, this can be resolved by including Clipboard.js yourself, either in a script tag or bundled into your JS. It’s specifically the plugin’s behavior to fallback to a CDN version if it doesn’t find Clipboard.js that is failing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "Uncaught TypeError: Illegal constructor"
The Illegal constructor error is thrown when a class extends HTMLElement, but is instantiated like a regular class. Using classes that inherits from ......
Read more >
Illegal constructor with EcmaScript 6 - javascript - Stack Overflow
It looks like you're trying to extend DOM's Node . You can't do that, it's defined as an abstract interface, and the host-provided...
Read more >
Uncaught TypeError: Illegal constructor in Chrome when a ...
I'm running into a frustrating problem with some custom elements I'm defining and am hoping for some bread crumbs from someone with a...
Read more >
1186698 - PeerConnection.js: TypeError: Illegal constructor
The answer is that an error is reported to the web console (and to the page's onerror handler), just without useful location information....
Read more >
Getting an error with effect.js in Chrome "Illegal Constructor"
Getting an error with effect.js in Chrome "Illegal Constructor" ... This is triggering an error in Chrome 39 ... Uncaught TypeError: Illegal constructor....
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