materialize: k.velocity is not a function

ERROR TypeError: k.velocity is not a function
    at h (materialize.js:3)
    at HTMLDivElement.<anonymous> (materialize.js:3)
    at HTMLDivElement.dispatch (jquery.js:4737)
    at HTMLDivElement.elemData.handle (jquery.js:4549)
    at Object.trigger (jquery.js:7807)
    at HTMLDivElement.<anonymous> (jquery.js:7875)
    at Function.each (jquery.js:365)
    at jQuery.fn.init.each (jquery.js:137)
    at jQuery.fn.init.trigger (jquery.js:7874)
    at jQuery.fn.init.open (materialize.js:3)
    at jQuery.fn.init.a.fn.modal (materialize.js:3)
    at HTMLDocument.<anonymous> (materialize-directive.js:185)
    at fire (jquery.js:3187)
    at Object.add [as done] (jquery.js:3246)
    at jQuery.fn.init.jQuery.fn.ready (jquery.js:3496)
View_OperationalComponent_1 @ OperationalComponent.html:6
DebugContext_.logError @ core.es5.js:13000
ErrorHandler.handleError @ core.es5.js:1145
next @ core.es5.js:4774
schedulerFn @ core.es5.js:3848
SafeSubscriber.__tryOrUnsub @ Subscriber.js:234
SafeSubscriber.next @ Subscriber.js:183
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3834
NgZone.triggerError @ core.es5.js:4205
onHandleError @ core.es5.js:4166
ZoneDelegate.handleError @ zone.js:369
Zone.runTask @ zone.js:168
ZoneTask.invoke @ zone.js:460


ERROR CONTEXT DebugContext_ {view: Object, nodeIndex: 13, nodeDef: Object, elDef: Object, elView: Object}

I am using Angular2 Cognito Quickstart with Materializecss. I am trying to open modal but I am facing the above issue. I have tried many issue related to this but many solutions includes webpack plugin addition or defining externals in webpack.config.js. I don’t contain webpack.config.js file in my folder structure created by this quickstart. Please help.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

guibot17 I had this issue recently and I found this Stack Overflow question and it solved my issue https://stackoverflow.com/questions/39998806/angular2-materialize-modals-dont-open

in my app.module.ts I had:

import "materialize-css"
import { MaterializeModule } from 'angular2-materialize'

I removed the first import statement it stopped the error:

// import "materialize-css"
import { MaterializeModule } from 'angular2-materialize'

@jflip that is because the angular2-materialize project wraps materialize-css and provides the MaterializeDirective directive for the components.

I’m having the same issue. I followed all the steps described in the installation guide of materialize along with its dependencies, but I’m getting the same message: ERROR TypeError: k.velocity is not a function at h (materialize.js:3) at HTMLDivElement.

Any help will be really appreciated