I self hosted appwrite and created a function and deployed it on github
I get this error on function build
And this is my repo
Did you have created the repository from scratch manually?
Or used a template?
From scratch
I creatd function locally then push it to my repo
And what's the function code?
i didn't edit the code its generated with the cli
`import { Client } from 'node-appwrite';
// This is your Appwrite function // It's executed each time we get a request export default async ({ req, res, log, error }) => { // Why not try the Appwrite SDK? // // const client = new Client() // .setEndpoint('https://cloud.appwrite.io/v1') // .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) // .setKey(process.env.APPWRITE_API_KEY);
// You can log messages to the console
// If something goes wrong, log an error error('Hello, Errors!');
// The req object contains the request data
if (req.method === 'GET') {
// Send a response with the res object helpers
// res.send() dispatches a string back to the client
return res.send('Hello, World!');
}
// res.json() is a handy helper for sending JSON
return res.json({
motto: 'Build like a team of hundreds_',
learn: 'https://appwrite.io/docs',
connect: 'https://appwrite.io/discord',
getInspired: 'https://builtwith.appwrite.io',
});
};`
and this is my config is it correct ?
The code doesn't seem to return anything
You should execute the return.res.json
Like i said this is just the appwrite generated code , is this excerpted behavior ?
From the code isn't this part a return return res.send('Hello, World!');
Hey there π The error seems to be regaring tarring or untarring. This usually means issues with rootDirectory. Can you try to rename folder to not include spaces? Let's see if that is the issue we are facing.
Hi thanks for your reply now it deployed but when excecute that code i get this error
`Could not load code file. Error: Cannot find module '/usr/local/server/src/function/main.js' Require stack:
- /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 execute (/usr/local/server/src/server.js:123:28) at /usr/local/server/src/server.js:158:33 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)`
Would you be able to create a github issue for the spaces problem?
What's your folder structure and what did you set for hte root directory and entrypoint?
Recommended threads
- After assigning a domain to my Dart func...
Iβve attached the images. Could anyone please explain how this execution is being performed?
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...
- Error trying to deploy functions from CL...
β Error β’ on-auth-create (6a00b2ab000c9ce2949b) β’ Server Error β Error: No functions were pushed. Prject ID: 69ffe0270033a4ac420a