Hello, I've set up a Function to delete user account completely from database.
This is my set up:
On delete account button press:
const response = await fetch("/api/deleteUser", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ userId: user.$id }),
});
Which goes to api/deleteUser: (picture 1)
Then the function set up with root entry functions/deleteUserFunction/index.js (picture 2)
The entrypoint set up (picture 3)
The error i get in Function logs:
Could not load code file. Error: Cannot find module 'node-appwrite' Require stack:
- /usr/local/server/src/function/functions/deleteUserFunction/index.js
- /usr/local/server/src/server.js at Module._resolveFilename (node:internal/modules/cjs/loader:939:15) at Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:81:25) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/usr/local/server/src/function/functions/deleteUserFunction/index.js:1:29) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Module._load (node:internal/modules/cjs/loader:827:12) at Module.require (node:internal/modules/cjs/loader:1005:19)
Thanks for help !
And this in my package.json in functions/deleteUserFunction, it said need appwrite will install it automatically but is not working
Dont rely on appwrite to do anything automatically from what i've learned
lmao
ok i wil try that
redeploy when u change it
your entrypoint is index.js
i write just index.js as entrypoint?
since you got this error /usr/local/server/src/function/functions/deleteUserFunction/index.js
your entrypoint was/is correct. just dont copy my screenshot for entrypoint
aah ok
@AidsMcGhee Now wth is this π€£
yeah.. run it again. ive created an issue ffor this and theyve yet to fix it. surprise lol
now back to this π€‘ π€‘
did you hit the redeploy button?
yes , now i re builded it. It does the multiple internal curl
So now I re test my fucntion on my website or i redploy?
Re testing on my website made the cannot find module before again
execute it again once u get the multiple curl error
back to cannot find
AAAAAAAAAA
why they remove delete account from client π€‘
you might need to fix your build env. when i build my typescript, it outputs a main.js and package.json file with no extra folders
if package.json is not at the root of the function tar.gz the npm install won't do anything
Recommended threads
- Project auto-blocked after load testing ...
Hi team π My project has been automatically blocked with the message: "Project is currently blocked β Access to this project is restricted. Contact support if...
- App build crashing with "Internal error"
Hello Appwrite team! π We are trying to deploy a Next.js application on Appwrite Cloud, but our builds are consistently failing. The deployment log successful...
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...