Cloudinary node.js plugin in Vue.js SPA project
Is there any way to use the plugin in a Vue.js app? I've installed it via npm, but get errors when I require/import it:
ERROR in ./~/cloudinary/lib/uploader.js
Module not found: Error: Can't resolve 'fs' in '/my_projects/vue-app/node_modules/cloudinary/lib'
@ ./~/cloudinary/lib/uploader.js 23:7-20
@ ./~/cloudinary/cloudinary.js
@ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./assets/js/components/Category.vue
@ ./assets/js/components/Category.vue
@ ./assets/js/routes.js
@ ./assets/js/app.js
Is there some dependency or webpack loader/plugin that I am missing, or am I going to have to bite the bullet and use the JQuery method?
-
I'm having a similar problem with this. I've installed cloudinary-core.
Error during compile:
This dependency was not found:
* fs in ./~/cloudinary/lib/uploader.js
To install it, you can run: npm install --save fsand "npm install --save fs" doesn't help.
Well, maybe not. If I include nothing, I'm able to compile and upload just fine.
-
Hi Jeff,
When you said "cloudinary-core", did you refer to https://github.com/cloudinary/pkg-cloudinary-core ?
Because if so, then note that this is a JavaScript library rather than a Node.js one.
-
No, I just pulled it in via node, but that wasn't the problem. It was my lack of skills using Vue. Based on internet searches, I believed I would have to use "import cloudinary..." in my Vue component. I ended up removing the import to get it to compile and then I found that it worked fine without an import.
Post is closed for comments.
Comments
6 comments