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
- Unable to connect the git repo with appw...
I am trying to connect my existing repo with the appwrite functions. I have 2 functions in the same repo, and i was able to execute those through cli and its vi...
- Creating a function on appwrite Cloud.
I am trying to create a function on Appwrite cloud. I go to the console. I hit : Create function I choose DART-3.5 I put a name for my function : NameFunction...
- Function connected custom domain error: ...
My domain is served through Cloudflare. Domain is now connected with the appwrite function. But when accessing the domain, I get the below error. Any suggestion...