[bug]: Getting error while trying to deletefiles
Closed this issue ยท 0 comments
CBZakaria commented
Provide environment information
System:
OS: Windows 10 10.0.19045
CPU: (12) x64 Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz
Memory: 15.35 GB / 31.92 GB
Binaries:
Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
pnpm: 9.6.0 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.19041.4355
npmPackages:
@uploadthing/react: ^6.7.2 => 6.7.2
typescript: ^5.5.3 => 5.5.4
uploadthing: ^6.13.2 => 6.13.2
Describe the bug
Trying to delete files using await utapi.deleteFiles(imageKeys); knowing that the component i'm using the utapi is "use server"
i'm getting the current error Error: Attempted to call g() from the server but g is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.
Link to reproduction
https://stackblitz.com/github/pingdotgg/uploadthing/tree/main/examples/minimal-appdir
To reproduce
wamp wamp
Additional information
No response
๐จโ๐งโ๐ฆ Contributing
- ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!
Code of Conduct
- I agree to follow this project's Code of Conduct