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

fail to resolve vue directive"v-shortkey" on the component #9686

Closed
madhuadbanker opened this Issue Mar 13, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@madhuadbanker
Copy link

madhuadbanker commented Mar 13, 2019

Version

2.5.13

Steps to reproduce

1 install vue-shortkey
2 created vue-shortkey.js in plugins as per nuxt documentation and added path
3 build appliaction in nodejs command prompt
4 open apllication in browser and specific component gives vue warn

What is expected?

to use combination keys E.g: ctrl s and have one listner

What is actually happening?

getting vue warn: failed to resolve directive: shortkey


I am using vue application ssr with nuxt. I have added the plugin as mentioned in nuxt documentation in 2 ways .

create pligins/vue-shortkey.js and given path in nuxt.config.js ...i got vue warning failed to resolve directive-shortkey
another way..my plugin in node_modules so given in build option of nuxt.config.js as transpile:['vue-shortkey'] but didnt create plugins/vue-shortkey.js...here also same error
another way i tried by give Vue.use(require('vue-shortkey'))in app.ts ..here i got document not found

@yyx990803

This comment has been minimized.

Copy link
Member

yyx990803 commented Mar 13, 2019

  1. Please make sure to provide proper reproduction
  2. This could be either a problem in vue-shortkey itself or with Nuxt - either way it should not be reported here.

@yyx990803 yyx990803 closed this Mar 13, 2019

@leopiccionia

This comment has been minimized.

Copy link

leopiccionia commented Mar 13, 2019

@madhuadbanker The document not found error makes me believe that the plugin is not SSR-compatible. Telling Nuxt to just install the plugin on client-side, like this example, maybe solves your problem.

@madhuadbanker

This comment has been minimized.

Copy link
Author

madhuadbanker commented Mar 13, 2019

@leopiccionia thank you I have implemented as shown in that nuxt documentation client side only, it works by giving ssr:false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.