Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: this.hammer is undefined #16

Open
pchtsp opened this issue Aug 4, 2021 · 4 comments
Open

Uncaught TypeError: this.hammer is undefined #16

pchtsp opened this issue Aug 4, 2021 · 4 comments

Comments

@pchtsp
Copy link

pchtsp commented Aug 4, 2021

Thanks for the library!
After installing I just copied the example:

<template>
  <timeline
    ref="timeline"
    :items="items"
    :groups="groups"
    :options="options"
  />
</template>

<script>
  import { Timeline } from 'vue-visjs'

  export default {
    name: 'GanttVis',
    components: {
      Timeline,
    },
    props: {
      experiment: {
        type: Object,
        required: true,
      },
      height: {
        type: Number,
        required: false,
        default: 500,
      },
    },
    data () {
      return {
        groups: [
          {
            id: 0,
            content: 'Group 1',
          },
        ],
        items: [
          {
            id: 0,
            group: 0,
            start: new Date(),
            content: 'Item 1',
          },
        ],
        options: {
          editable: true,
        },
      }
    },
    computed: {

    },
  }
</script>

And I get the following error when clicking the box:

Uncaught TypeError: this.hammer is undefined
    _repaintDragCenter vue-visjs.esm.js:19295
    _repaintDomAdditionals vue-visjs.esm.js:19407
    redraw vue-visjs.esm.js:19415
    redraw vue-visjs.esm.js:19415
    setData vue-visjs.esm.js:19262
    _onDrag vue-visjs.esm.js:20307
    onMoving vue-visjs.esm.js:19939
    _onDrag vue-visjs.esm.js:20307
    _onDrag vue-visjs.esm.js:20292
    propagatedHandler vue-visjs.esm.js:17323
    emit vue-visjs.esm.js:7971
    emit vue-visjs.esm.js:6874
    emit vue-visjs.esm.js:6879
    emit vue-visjs.esm.js:7298
    tryEmit vue-visjs.esm.js:6905
    recognize vue-visjs.esm.js:6958
    recognize vue-visjs.esm.js:7808
    inputHandler vue-visjs.esm.js:6001
    handler vue-visjs.esm.js:6224
    domHandler vue-visjs.esm.js:6076
    addEventListeners vue-visjs.esm.js:6026
    each vue-visjs.esm.js:5473
    addEventListeners vue-visjs.esm.js:6025
    init vue-visjs.esm.js:6101
    Input vue-visjs.esm.js:6080
    PointerEventInput vue-visjs.esm.js:6185
    createInputInstance vue-visjs.esm.js:6605
    Manager vue-visjs.esm.js:7715
    Hammer vue-visjs.esm.js:8176
    PropagatingHammer vue-visjs.esm.js:17154
    _create vue-visjs.esm.js:18533
    Timeline vue-visjs.esm.js:20878
    mounted vue-visjs.esm.js:21941
    VueJS 18
    init vue-router.esm.js:2989
    init vue-router.esm.js:2988
    updateRoute vue-router.esm.js:2409
    transitionTo vue-router.esm.js:2263
    confirmTransition vue-router.esm.js:2397
    step vue-router.esm.js:2001
    step vue-router.esm.js:2008
    runQueue vue-router.esm.js:2012
    confirmTransition vue-router.esm.js:2392
    step vue-router.esm.js:2001
    step vue-router.esm.js:2005
    iterator vue-router.esm.js:2379
    resolve vue-router.esm.js:2127
    once vue-router.esm.js:2203
    promise callback*resolveAsyncComponents/</< vue-router.esm.js:2150
    flatMapComponents vue-router.esm.js:2171
    flatMapComponents vue-router.esm.js:2171
    flatMapComponents vue-router.esm.js:2170
    resolveAsyncComponents vue-router.esm.js:2106
    iterator vue-router.esm.js:2357
    step vue-router.esm.js:2004
    step vue-router.esm.js:2008
    step vue-router.esm.js:2008
    step vue-router.esm.js:2005
    iterator vue-router.esm.js:2379
    <anonymous> router.js:63
    iterator vue-router.esm.js:2357
    step vue-router.esm.js:2004
    step vue-router.esm.js:2008
    runQueue vue-router.esm.js:2012
    confirmTransition vue-router.esm.js:2387
    transitionTo vue-router.esm.js:2260
    push vue-router.esm.js:2704
    iterator vue-router.esm.js:2375
    <anonymous> router.js:59
    iterator vue-router.esm.js:2357
    step vue-router.esm.js:2004
    step vue-router.esm.js:2008
    runQueue vue-router.esm.js:2012
    confirmTransition vue-router.esm.js:2387
    transitionTo vue-router.esm.js:2260
    push vue-router.esm.js:2704

Looks similar to visjs/vis-timeline#1108

@pchtsp
Copy link
Author

pchtsp commented Aug 6, 2021

As advised in https://stackoverflow.com/questions/67080908/vis-timeline-7-and-angular-11 I manually installed vis-timeline at version 7.4.4 (I had to uninstall vue-visjs because it requires 7.4.8 for some reason). I'm now using vis-timeline directly.

Maybe a possible workaround would be to change the dependency on vis-timeline from "^7.4.8" to "^7.4.4" in order to install an older version of vis-timeline?

vue-visjs/package.json

Lines 41 to 43 in d11b710

"vis-timeline": "^7.4.8",
"vis-util": "^5.0.1",
"vue": "~2.x",

@alexdeia
Copy link

I found an error in the code, I will prepare a PR

@benincasantonio
Copy link

Hi, thank you very much for the hard work with the library!
I have a similar problem, as described above. When will this problem be fixed? Can I help in some way?
Thank you so much for your attention.

@alexdeia
Copy link

@benincasantonio I guess will be quicker if you can just create a fork and update visjs dependencies. I noticed this here #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants