
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
- coolify/appwrite ssl functions
(Sorry for m english, i'm french) Hello, i tried for 3 days to generate ssl for domain function like idfunction.appwrite.christophe-le-goff.dev. I install appwr...
- Error on updating Functions build comman...
I try to update the "build command" of one of my functions using the Console UI, but I always get an unknown server error (see screenshots). I can change other ...
- REST API does not work for queries
``` curl -X GET "https://cloud.appwrite.io/v1/databases/<db-id>/collections/<c-id>/documents" -H "X-Appwrite-Project: <project-id>" -H "X-Appwrite-Key: <key>"...
