
Hello guys, i just installed a javascript libary to my cloud function project and now i'm getting this error

can you show me your package.json file

here is the package.json

remove this "type": "module"
from your package.json and try again

okay

also can you show the main.js
file

now, i'm getting this

here is the main.js

use import axios from 'axios';
for importing axios, and add "type": "module"
back to package.json

require()
is only available in CommonJS, but import
can only be used in ES Modules

so how do i use the import with axios


If your issue has been solved, you can mark this post as closed by adding "[SOLVED]" to the beginning of the title
Recommended threads
- Appwrite Function get Execution ID
Is there a way to get the execution Id of the function's "own" execution inside the function? I couldn't find any environment variable for it [here](https://app...
- Functions fail to deploy after switching...
Hi <@1087889306208718959> , after switching my self-hosted Appwrite instance to use AWS S3 as the storage backend, my Cloud Functions stopped working. I’m runni...
- Error setting postman body
Good evening, anyone has an idea on how to pass body to appwrite function using postman? this is how I've passed it : { "providerName": "adamu" } and I ke...
