Rank 2: Process
I self hosted appwrite and created a function and deployed it on github
I get this error on function build
Votes
0
Replies
17
Participants
Unknown
Messages
18
Rank 2: Process
I self hosted appwrite and created a function and deployed it on github
I get this error on function build
Rank 2: Process
And this is my repo
Did you have created the repository from scratch manually?
Or used a template?
Rank 2: Process
From scratch
Rank 2: Process
I creatd function locally then push it to my repo
And what's the function code?
Rank 2: Process
i didn't edit the code its generated with the cli
Rank 2: Process
`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',
});
};`
Rank 2: Process
and this is my config is it correct ?
The code doesn't seem to return anything
You should execute the return.res.json
Rank 2: Process
Like i said this is just the appwrite generated code , is this excerpted behavior ?
Rank 2: Process
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.
Rank 2: Process
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:
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?