angular-tree-control icon indicating copy to clipboard operation
angular-tree-control copied to clipboard

0.2.30 Crashes Hard

Open mike-ward opened this issue 7 years ago • 12 comments
trafficstars

Been using this control for several years and really like it. However, upgrading from 0.2.28 to 0.2.30 crashes my app. I'm not getting any feedback in the console. My app simply doesn't load. This is usually indicative of a null reference to an expected object. Wish I had more but I'm on a deadline right now.

Running AngularJS 1.6.9, any browser reproduces the issue.

mike-ward avatar Feb 12 '18 15:02 mike-ward

Did you include the context-menu.js file? we have merged a pull request a few days ago that added this support.

@stueynz can you have a look?

yoavaa avatar Feb 12 '18 20:02 yoavaa

Not sure if related. When I use 0.2.30 with context-menu.js, I get the following exception:

[$injector:strictdi] function(e) is not using explicit annotation and cannot be invoked in strict mode

When I revert back to 0.2.28, everything works again. My apologies if this comment isn't related to the crash OP reported.

frame avatar Feb 16 '18 11:02 frame

Hi,

Same problem here since last update. The angular App won't build, and I have this error in the console:

Error: [$injector:modulerr] Failed to instantiate module app due to:
[$injector:modulerr] Failed to instantiate module treeControl due to:
[$injector:modulerr] Failed to instantiate module contextMenu due to:
[$injector:nomod] Module 'contextMenu' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.6.9/$injector/nomod?p0=contextMenu
minErr/<@http://localhost:3043/build/bundle.js:71596:12
module/<@http://localhost:3043/build/bundle.js:73783:17
ensure@http://localhost:3043/build/bundle.js:73704:38
module@http://localhost:3043/build/bundle.js:73781:14
loadModules/<@http://localhost:3043/build/bundle.js:76479:22
forEach@http://localhost:3043/build/bundle.js:71888:11
loadModules@http://localhost:3043/build/bundle.js:76463:5
loadModules/<@http://localhost:3043/build/bundle.js:76481:40
forEach@http://localhost:3043/build/bundle.js:71888:11
loadModule…

I've checked, the context-menu.js file is present in the node_modules\angular-tree-control\ folder.

Zorkeel avatar Feb 16 '18 11:02 Zorkeel

@Zorkeel: You also need to include context-menu.js via

frame avatar Feb 16 '18 11:02 frame

@frame: Thanks ! That was the missing part. Works perfectly now.

Zorkeel avatar Feb 16 '18 13:02 Zorkeel

Why the extra file instead of integrating into the script?

mike-ward avatar Feb 16 '18 13:02 mike-ward

And why this breaking change on a patch version increment?

Daanoz avatar Feb 21 '18 08:02 Daanoz

our huge codebase depends on this and now you broke our build.. really why in a patch increment? please make sure not to make the same mistake again

nazihahmed avatar Apr 17 '18 07:04 nazihahmed

The readme says that the context menu script is optional if not using the menu-id attribute, which I am not.

I think the author doesn't understand semver, which is critical information for a JS developer. I hope they educate themselves soon!

stevenvachon avatar Jun 22 '18 00:06 stevenvachon

If you don't want to add the context menu, and its js file, add this workaround to your existing module definitions:

angular.module("contextMenu", []);

And carry on as normal.

ashclarke avatar Oct 16 '18 10:10 ashclarke

@stevenvachon

I think the author doesn't understand semver, which is critical information for a JS developer. I hope they educate themselves soon!

From SemVer spec:

4. Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.

ashclarke avatar Oct 18 '18 15:10 ashclarke

Can't you just put something like require && require('./context-menu.js') inside angular-tree-control.js?

vipseixas avatar Mar 26 '19 19:03 vipseixas