Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Function create doesn't work #20

Open
2 tasks done
albertoescala opened this issue Jul 12, 2023 · 1 comment
Open
2 tasks done

馃悰 Bug Report: Function create doesn't work #20

albertoescala opened this issue Jul 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@albertoescala
Copy link

馃憻 Reproduction steps

  1. Clone the repository.
  2. Install dependency npm install.
  3. Run start script npm run start.

Node: 18.15.0
node-appwrite: 9.0.0

馃憤 Expected behavior

According to the documentation, It should create the function.

馃憥 Actual Behavior

When I run npm run start, the creation of a function responds to an error:

Running Create Function API
AppwriteException [Error]: Invalid execute: Roles must be an array of strings.
    at Client.call (/Applications/Back/playground-for-node/node_modules/node-appwrite/lib/client.js:172:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Functions.create (/Applications/Back/playground-for-node/node_modules/node-appwrite/lib/services/functions.js:111:16)
    at async createFunction (/Applications/Back/playground-for-node/src/app.js:419:22)
    at async runAllTasks (/Applications/Back/playground-for-node/src/app.js:537:5) {
  code: 400,
  type: 'general_argument_invalid',
  response: {
    message: 'Invalid execute: Roles must be an array of strings.',
    code: 400,
    type: 'general_argument_invalid',
    version: '0.10.45'
  }
}

The creation of the function:

const createFunction = async () => {
    console.log(chalk.greenBright('Running Create Function API'));

    const response = await functions.create(
        ID.unique(),
        "Node Hello World",
        [Role.any()],
        "node-16.0"
    );

    functionId = response.$id;

    console.log(response);
}

馃幉 Appwrite version

Version 0.10.x

馃捇 Operating system

MacOS

馃П Your Environment

No response

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@albertoescala albertoescala added the bug Something isn't working label Jul 12, 2023
@Sahilll15
Copy link

it works close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants