Hi,
I am using Angular4 and upgraded to the latest version of the tree and i get this error "(void 0) is not a function"
Tree version 3.4.0 works fine but all above that i got this error.
Angular 4 starts on which tree version
I dont know what more information i can give..
Sorry and thanks
i just update all dependencies and i still get this error
UnitHierarchy.html:4 ERROR TypeError: (void 0) is not a function
at new e (eval at
at new e (eval at
at createClass (eval at
at _createProviderInstance (eval at
at createProviderInstance (eval at
at createViewNodes (eval at
at callViewAction (eval at
at execComponentViewsAction (eval at
at createViewNodes (eval at
at createEmbeddedView (eval at
at callWithDebugContext (eval at
at Object.debugCreateEmbeddedView [as createEmbeddedView] (eval at
at TemplateRef_.createEmbeddedView (eval at
at ViewContainerRef_.createEmbeddedView (eval at
at UnitView.ngOnInit (eval at
at checkAndUpdateDirectiveInline (eval at
at checkAndUpdateNodeInline (eval at
at checkAndUpdateNode (eval at
at debugCheckAndUpdateNode (eval at
at debugCheckDirectivesFn (eval at
at Object.eval [as updateDirectives] (ng:///OrganizationModule/UnitView_Host.ngfactory.js:11:5)
at Object.debugUpdateDirectives [as updateDirectives] (eval at
at checkAndUpdateView (eval at
at callViewAction (eval at
at execEmbeddedViewsAction (eval at
at checkAndUpdateView (eval at
at callViewAction (eval at
at execComponentViewsAction (eval at
at checkAndUpdateView (eval at
at callWithDebugContext (eval at
at Object.debugCheckAndUpdateView [as checkAndUpdateView] (eval at
at ViewRef_.detectChanges (eval at
at eval (eval at
at Array.forEach (native)
at ApplicationRef_.tick (eval at
at eval (eval at
at ZoneDelegate.invoke (eval at
at Object.onInvoke (eval at
at ZoneDelegate.invoke (eval at
at Zone.run (eval at
at NgZone.run (eval at
at Object.next (eval at
at SafeSubscriber.schedulerFn [as _next] (eval at
at SafeSubscriber.__tryOrUnsub (eval at
at SafeSubscriber.next (eval at
at Subscriber._next (eval at
at Subscriber.next (eval at
at EventEmitter.Subject.next (eval at
at EventEmitter.emit (eval at
at NgZone.checkStable (eval at
at NgZone.setHasMicrotask (eval at
at Object.onHasTask (eval at
at ZoneDelegate.hasTask (eval at
at ZoneDelegate._updateTaskCount (eval at
at Zone._updateTaskCount (eval at
at Zone.runTask (eval at
at drainMicroTaskQueue (eval at
at HTMLFormElement.ZoneTask.invoke (eval at
I'm getting the same error with angular 2.3.1 and webpack 1.13.2
Works when I downgrade to angular-tree-component 3.2.3
Like those above, I'm getting the same thing here. Any version > 3.2.3 fails with (void 0) is not a function.
...That's on SystemJS though.
That said, I've seen you've since decided to stop supporting SystemJS entirely.
I don't think a library should dictate what kind of bundler (SystemJS does have one too), should a project have. Especially one that had been the go to for the Angular team just a year back (and still remains for many seed projects).
Nevertheless, I'm not looking to complain but instead I would love to know what were the issues and see if I can help fix them, given a proper issue describing what fails were to open.
Still, more than anything I resent a condescending comment such as:
_Modern_ web applications use bundlers like Webpack.
@roni-frantchi, sorry if that felt condenscending - and you are completely right. Every technology choice is per requirements and project. I decided to stop supporting it because it brings too many issues, and I saw many other packages are dropping support.
However, I still want to keep encouraging people to use webpack. But again - I was wrong the way I wrote it.
@sadplace, @psilospore can you share your config files ?
package.json, angular-cli.json, webpack.config.js
Thanks
@adamkleingit I apologize if I had come on to strong. I do appreciate your reply.
My sincere thanks for a great library.
I'll post in this thread if I'll be able to figure out the (void 0) is not a function I got when using System.
Maybe it'll remedy the Webpack issue seen here as well.
I'm seeing this too and it looks like it would affect anyone using the UMD bundle. Since 3.4.1, the UMD bundle contains a function invocation on (void 0). There are two of them in the most recent code. They originate in lib/models/tree-options.model.ts through the use of the two lodash methods: defaultsDeep and omit. Unlike other files using lodash, this one doesn't to a destructuring, it just references the functions from the underscore identifier directly. It seems like the Rollup uglify step is probably over optimizing.
So the issue was fixed for me by adding the dependencies to Rollup's external list: mobx, mobx-angular, lodash. Is the UMD file maintained?
I have the same question. In this case the fix is very simple (adding lodash to rollup.config) and after that it works with system.js. Is it possible to do it?
I'll put in a pull request with the changes. FWIW, it would also work if the appropriate lodash methods were added to the rollup config's commonjs plugin, but then lodash would still be bundled in the umd, which is a waste (plus, it is listed as a dependency anyway).
I just received this issue using angular-cli, but only for the production build, probably during uglyification.
This was a dependency problem - should be fixed in latest version
I get the same error only when using --prod and only after upgrading to angular version 5. It only happens about 50% of the time. Executing the same command again always fixes the problem. I am not using the tree component that others have mentioned. I am certain it has nothing to do with an external library. Because it would happen 100% of the time. The issue should not have been closed.
-snip-
This should probably be posted on the @angular github.
@broweratcognitecdotcom yep still happening with --prod
my project work well when ng s --prod, but cannot work well and error happen"(void 0) is not a function" when it is used in a websphere project...
why? why? why? help~~~
Most helpful comment
I get the same error only when using --prod and only after upgrading to angular version 5. It only happens about 50% of the time. Executing the same command again always fixes the problem. I am not using the tree component that others have mentioned. I am certain it has nothing to do with an external library. Because it would happen 100% of the time. The issue should not have been closed.