sweet-modal-vue icon indicating copy to clipboard operation
sweet-modal-vue copied to clipboard

Can not resolve module

Open anthonywebster opened this issue 6 years ago • 8 comments

captura de pantalla de 2017-11-12 15 16 24

anthonywebster avatar Nov 12 '17 21:11 anthonywebster

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 avatar Nov 16 '17 01:11 daverogers

@daverogers I solved adding these lines in my webpack configuration

captura de pantalla de 2017-11-15 22 04 55

anthonywebster avatar Nov 16 '17 04:11 anthonywebster

Confirmed successful build after adding this line to webpack: extensions: ['*', '.js', '.vue'],

Cheers 🍻

daverogers avatar Nov 16 '17 07:11 daverogers

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)

lipsumar avatar Dec 12 '17 12:12 lipsumar

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)

martinhschei avatar Jan 17 '18 13:01 martinhschei

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.

scottadamsmith avatar Apr 06 '18 21:04 scottadamsmith

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.

martinhschei avatar Aug 23 '18 10:08 martinhschei

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'

MoSha-lab avatar Nov 08 '21 09:11 MoSha-lab