What is the reason Nuxt can't see this package in plugin?
import Vue from 'vue'
import VueMdcAdapter from 'vue-mdc-adapter'
Vue.use(VueMdcAdapter)
plugins: [
{src: '~plugins/mdc.js', ssr: false}
],
What is wrong with it? What do you want from me, Nuxt?
This dependency was not found:
* vue-mdc-adapter in ./plugins/mdc.js
To install it, you can run: npm install --save vue-mdc-adapter
I installed it, you dumbo.
I lost my count how many packages are not working with Nuxt. Probably 90% will never start out of the box.
Hi @jerakode
Actually I just tried to use vue-mdc-adapter and indeed I had the same error. I took a look at is and it's not nuxt.js fault.
Indeed, if you look at the main field of the package.json of vue-mdc-adapter: https://github.com/stasson/vue-mdc-adapter/blob/master/package.json#L15
You can see it points to components/index.js, I installed vue-mdc-adapter and in node_modules/vue-mdc-adapter/, there is no components/ folder but only a dist/ folder.
So I updated updated the way to import it this way:
import Vue from 'vue'
import VueMdcAdapter from 'vue-mdc-adapter/dist/vue-mdc-adapter.js'
import 'vue-mdc-adapter/dist/vue-mdc-adapter.css'
Vue.use(VueMdcAdapter)
And it works perfectly!
Code: https://glitch.com/edit/#!/nuxt-vue-mdc-adapter?path=plugins/mdc.js:5:22
Demo: https://nuxt-vue-mdc-adapter.glitch.me/
Sorry about nuxt.js displaying this error but it's pretty rare that a npm package is broken (I guess it's because they are still in alpha).
@Atinux thanks and sorry for my expression. I guess I really need a vacation.
And YEY!!! At last I found working MDC library! :fireworks:
Hi @Atinux
Thanks a lot for the finding. I'll fix this asap. I'll guess I'll add dist/index.js and have the package:main point to it. Not sure if I should do a dedicated webpack.config for that...
vue-mdc-adapter is still in dev and it's indeed a little bit early to use it (I've released on npm just to test the build for cdn...) I still have to finalize bundling, freeze components api's, deal with the tests...
Regarding Nuxt, I've just discovered this project. I must say I'm impressed! Do you know if there is some kind for guidelines or checklist we need to follow to ensure vue components will be compatible with nuxt and ssr?
@stasson I am not the specialist (consider that), but may be this topic will be helpful - https://github.com/nuxt/nuxt.js/issues/673
And again - thanks for package!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @jerakode
Actually I just tried to use
vue-mdc-adapterand indeed I had the same error. I took a look at is and it's not nuxt.js fault.Indeed, if you look at the
mainfield of thepackage.jsonofvue-mdc-adapter: https://github.com/stasson/vue-mdc-adapter/blob/master/package.json#L15You can see it points to
components/index.js, I installedvue-mdc-adapterand innode_modules/vue-mdc-adapter/, there is nocomponents/folder but only adist/folder.So I updated updated the way to import it this way:
And it works perfectly!
Code: https://glitch.com/edit/#!/nuxt-vue-mdc-adapter?path=plugins/mdc.js:5:22
Demo: https://nuxt-vue-mdc-adapter.glitch.me/
Sorry about nuxt.js displaying this error but it's pretty rare that a npm package is broken (I guess it's because they are still in alpha).