NyllRE / nuxt-file-storage

Easy solution to store files in your nuxt apps. Be able to upload files from the frontend and recieve them from the backend to then save the files in your project.
https://nuxt.com/modules/nuxt-file-storage
MIT License
63 stars 7 forks source link

[nuxt] [request error] [unhandled] [500] storeFileLocally is not defined #3

Closed VladislavG closed 4 months ago

VladislavG commented 4 months ago

[nuxt] [request error] [unhandled] [500] storeFileLocally is not defined What did I do wrong?

NyllRE commented 4 months ago

could you provide more details and/or reproduction using stackblitz or codesandbox?

NyllRE commented 4 months ago

I believe the issue is that you didn't import the function from the library

VladislavG commented 4 months ago

I'm just starting to learn Nuxt, could you help? I need a solution to upload files to the server, I used the code from your example, but it doesn't work.. How do I import the storeFileLocally function from your library? I did everything your way Readme.md

NyllRE commented 4 months ago

hey @VladislavG , I realized there is an issue with importing. you did everything right and it's a problem on my end so I will be fixing that and I will let you know when it's working

VladislavG commented 4 months ago

Thanks!

NyllRE commented 4 months ago

Hey @VladislavG , I have just fixed the issue and it should be automatically imported now, please update the package to v0.2.2 and check and tell me if you find any other issues so I can close this issue.

NyllRE commented 4 months ago

also since you are new to nuxt feel free to reach out to me on any nuxt topic in general!

VladislavG commented 4 months ago

Hi! Thanks! The function is being imported now, but another error has appeared, maybe I'm doing something wrong..

[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'split') at parseDataUrl (E:\Programms\OpenServer\OpenServer\domains\nuxt\node_modules\nuxt-file-storage\dist\runtime\server\utils\storage.mjs:26:20) at storeFileLocally (E:\Programms\OpenServer\OpenServer\domains\nuxt\node_modules\nuxt-file-storage\dist\runtime\server\utils\storage.mjs:4:33) at (E:\Programms\OpenServer\OpenServer\domains\nuxt\server\api\files.ts:4:1) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.handler (/E:/Programms/OpenServer/OpenServer/domains/nuxt/node_modules/h3/dist/index.mjs:1697:19) at async Server.toNodeHandle (/E:/Programms/OpenServer/OpenServer/domains/nuxt/node_modules/h3/dist/index.mjs:1907:7)

VladislavG commented 4 months ago

I understand that the error occurs in the storage.mjs file in the parseDataUrl function because the argument of the file function is empty.

NyllRE commented 4 months ago

could you give me the code or a reproduction?

NyllRE commented 4 months ago

also tell me what file did you try to upload

VladislavG commented 4 months ago

I will use Laravel in my projects. There are no such difficulties in PHP..

NyllRE commented 4 months ago

I understand, this library is still very new and only maintained by me so I apologize for the inconvenience, if you could just help me understand what the issue you were facing is so I can solve it I would very much appreciate it, otherwise I will just close this issue

NyllRE commented 4 months ago

closing this issue for lack of information on the issue