N
Nuxtβ€’2y ago
Mahsa

Minio package is not compatible with nuxt3 since it use commonjs

Hello everyone reading this post, I find myself in quite a predicament with an issue I'm facing. I'm working on implementing a file uploader in Nuxt3, which is not SSR, and the server I'm using is Minio. After some research, I found that the best compatible S3 library for Minio is the one they published on GitHub: https://github.com/minio/minio-js. However, integrating this library into Nuxt3 has proven to be quite challenging. Since it's based on CommonJS, I attempted to transpile it in the nuxt.config.ts file, but this approach led to a series of errors. I tried importing it using the following method: "import * as Minio from 'minio'". Unfortunately, this resulted in the following error: "The requested module '/_nuxt/node_modules/fast-xml-parser/src/fxp.js?v=60a1ec0a' does not provide an export named 'XMLParser'." It feels like I'm digging myself deeper into this problem. If any of you have any ideas on how to overcome this hurdle, I would greatly appreciate your assistance. ❀️‍πŸ”₯
5 Replies
conner
connerβ€’2y ago
Hey @Mahsa, first of all. The minio package is built for Node and not for Browser, you should use it on backend-side. Also this is a minio related issue. You can try to use it on a Nitro Server Endpoint
Mahsa
MahsaOPβ€’2y ago
Thank you, Conner. You're absolutely right that it's not specifically for Nuxt, but I figured someone who has experience with any S3 library might have some advice for me.
conner
connerβ€’2y ago
Yes, but as I said. The MinIO package has to run in a node environment. Not on Browser Side.
Mahsa
MahsaOPβ€’2y ago
Yeah , I'm trying to use aws-sdk
conner
connerβ€’2y ago
Great Idea! πŸ‘
Want results from more Discord servers?
Add your server