vue-chat-scroll: Require vue-chat-scroll returns empty object
after install the latest version with npm:
> require('vue-chat-scroll')
{}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 58 (19 by maintainers)
Commits related to this issue
- Fix dependency on Vue (#12) fixes #8 — committed to theomessin/vue-chat-scroll by kylestev 7 years ago
- Fix dependency on Vue (#12) fixes #8 — committed to theomessin/vue-chat-scroll by kylestev 7 years ago
I doesn’t work for me as well. I’m using:
and then
and I’m getting
[Vue warn]: Failed to resolve directive: chat-scrollerrorYea, sorry man 😦 I’m using
1.1.1and having this issue too 😕From my
yarn.lock:Doing
does not register the directive, even though console is logging this:
Standard
const VueChatScroll = require('vue-chat-scroll')logs out as an empty object.Worked for me once I added Vue.use(require(‘vue-chat-scroll’)) to my main.js. I think the bullet points in the documentation make this step seem optional, since it is same indentation level as the npm install instructions, despite the fact that both are required. Just something to help beginners.
Will eventually fix this… One day. Soon™
i stumbled upon similiar issue with my plugin, hence found this thread while trying to solve it, in my case i added output.libraryTarget: ‘commonjs2’ in webpack.conf in the plugin. Then i can use the plugin just fine with: import * as MyPlugin from ‘my-plugin’ Vue.use(MyPlugin)
might be worth a shot for you guys
Yup understand. It definitely need to be fixed properly. Thanks for the great plugin!
On top of my head, the easiest hack is to remove the line
/srcin .npmignore and we can happily importsrc/vue-chat-scroll.js:p For those who uses webpack should bundle the file themselves anyway, so it should not be a problem@theomessin i actually copied and adapted the code here, just wanted to let you know that there is an issue. it also helpful for others who come across this library, so that they don’t waste their time trying to find out that it’s not working in some setups.
Not for me. I still have the same problem.
I’m getting this as well. I’ll see if I can get a reproducible repo up for you.
This snippet will mute the error about missing directive, but it still doesn’t work 😞
I’m experiencing this issue as well. I created a [pen] trying to reproduce my error, but it seems it works fine there 😅
you can find our project here: https://github.com/sarahschuetz/IM531_ProjectT1
we are using vue together with nuxt so I tried implementing it as a Plugin like explained here https://nuxtjs.org/guide/plugins/#__nuxt