sweet-modal-vue
sweet-modal-vue copied to clipboard
Can not resolve module
I'm running into the same error. I tried installing both globally and on a single component (import { SweetModal, SweetModalTab } from 'sweet-modal-vue'
)
@daverogers I solved adding these lines in my webpack configuration
Confirmed successful build after adding this line to webpack:
extensions: ['*', '.js', '.vue'],
Cheers 🍻
For me it was this that solved the "module not found" error: https://github.com/adeptoas/sweet-modal-vue/issues/44 + import SweetModal from 'sweet-modal-vue/src/plugin.js'
(src/
is missing in the docs)
I had almost the same error after installing it globally.
This dependency was not found: sweet-modal-vue/plugin.js in ./src/main.js To install it, you can run: npm install --save sweet-modal-vue/plugin.js
tried adding /src to the import path ( 'sweet-modal-vue/src/plugin.js' ) and it now works. thanks!
(edit: typo)
All the solutions noted in here sound as though you are allowing this library to be built via your app's webpack config. That seems like a dangerous path to me. What if the library opts to switch from Sass to some other option like Less down the road? I believe you'd have to update your config to setup loaders for it. Please correct me if I am wrong, but it seems to me that something needs to change in the library so that your webpack config does not have an impact on importing the library.
after working perfectly for several months npm now gives this error when running npm watch-poll:
Module not found: Error: Can't resolve 'sweet-modal-vue/src/plugin.js'
if i remove /src/plugin.js we are back to the error mentioned above.
anyone?
--- EDIT
seems like the module actually was removed after re-adding it with npm it now works like before.
For me it was this that solved the "module not found" error: #44 +
import SweetModal from 'sweet-modal-vue/src/plugin.js'
(src/
is missing in the docs)
Thanks to this mention, in my case, it solved almost same by import { SweetModal , SweetModalTab } from 'sweet-modal-vue/dist/sweet-modal'