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.

How to unregister the extension?

See original GitHub issue

I register the extension with:

cxtmenu(cytoscape)

But how to unregister?

Unregistering is needed in conjunction with Webpack’s hot module replacement.

If not unregistered the extension might get registered again while development, causing this error:

Can not register `cxtmenu` for `core` since `cxtmenu` already exists in the prototype and can not be overridden

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mirkolenzcommented, Jun 22, 2021

For me, the following worked:

import cytoscape from "cytoscape";
import cxtmenu from "cytoscape-cxtmenu";

cytoscape.use(cxtmenu);
// eventually other calls to cytoscape.use()
cytoscape.use = () => {};
3reactions
jricommented, Jan 21, 2018

Meanwhile I investigated it further and found I was wrong here:

The Cytoscape instance seems corrupted somehow then. Possibly this is because setExtension() terminates early, returning the result of overrideErr() instead the extensions map (but I’m not sure about this).

Actually it’s due to my application, not Cytoscape, that the canvas is not rendered when hot replaced. Sorry for bothering you.

But still, Cytoscape reports the console message as an error, not as a warning which I can safely ignore. That gave me the (wrong) impression the problem is in Cytoscape.

screen shot 2018-01-21 at 13 33 04

Cytoscape should display that console message as a warning, not as an error. That would have avoided the entire misunderstanding in the first place.

And still I think an explicit unregister Core call is desired. This way the overrideErr could be prevented in the first place.

Thank you for the support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unregister a Plug-In Package
Click Invoke Method to unregister the extension. Unregistering a plug-in package on vCenter Server does not delete the plug-in package files that are...
Read more >
How to Uninstall Extensions in Chrome, Firefox, and Other ...
Click the “x” button to the right of an extension to remove it, or click the “Disable” button under an extension to disable...
Read more >
How to delete or unregister vSphere Replication extension or ...
Under Methods, select void > UnregisterExtension.​​ Click Invoke Method. You will see the message as “void“, which means its unregistered. Log in to...
Read more >
How to unregister vCenter plugin/extension using the MOB
Select the specific plugin and then click on remove button. Here are the instructions to remove a specific plugin/extension from your vCenter ...
Read more >
How to remove or uninstall Chrome extensions
How to uninstall an extension on Chrome · Open Chrome, and click / tap the menu button “…” · Click / tap More...
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