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.

Failed to resolve directive: touch

See original GitHub issue

Using this library into another library and then importing the 2nd library doesn’t work.

We have a Modal component on the https://github.com/nextcloud/nextcloud-vue library and we wanted to use your library, though when importing the modal component on another app, we get the Failed to resolve directive: touch error.

Though importign and using your library on the nextcloud-vue library is done properly:

import Vue from 'vue'
import Vue2TouchEvents from 'vue2-touch-events'

Vue.use(Vue2TouchEvents)

I’m guessing this is because you don’t export your plugin as a ssr module or something webpack can understand and pack and bundle on other libraries. But I might be wrong! 😃

EDIT: I was close, this is because you do not export the directive itself but only the {install:xxx, …} object Vue.use requires. Please check https://github.com/Akryum/v-tooltip/blob/master/src/index.js for a working example. It exports the vue directive as well so that webpack can understand how things works and include everything.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
alekblesscommented, Dec 4, 2020

Is there any option to define a custom directive when installing? I’am using Vuetify and the component “v-touch” seems to override this package.

import Vue2TouchEvents from 'vue2-touch-events';
Vue.use(Vue2TouchEvents);
1reaction
aezurcommented, Apr 24, 2020

I had the same issue and it was caused by having 2 plugins in the same Vue.use. I changed Vue.use(Argon, Vue2TouchEvents); to

Vue.use(Argon);
Vue.use(Vue2TouchEvents);
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Vue warn]: Failed to resolve directive: touch (found in
Please repeat the password. Topic: [Vue warn]: Failed to resolve directive: touch (found in <MdbCarousel>) Please insert min. 20 characters.
Read more >
v-touch-swipe error | Quasar Framework Community
I have the error [Vue warn]: Failed to resolve directive: touch-swipe My component code is Check the line /* eslint-disable */ import types ......
Read more >
Vee-validate - [Vue warn]: Failed to resolve directive: validate
I'm getting this error : Property or method "field" is not defined on the instance but referenced during render. – user3653474. Aug 14,...
Read more >
Touch Pan Directive - Quasar Framework
Due to performance reasons, not all of the modifiers are reactive. Some require a window/page/component refresh to get updated. Please check the API...
Read more >
Resize directive — Vuetify
Vuetify is a Material Design component framework for Vue.js. It aims to provide all the tools necessary to create beautiful content rich ...
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