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
- AppwriteException - Transaction with the...
I am using "node-appwrite" module and I have successfully created transaction id but when passing it to tablesDB.createRow function with some other required dat...
- Cannot create cloud function due to this...
As I try to deploy a new function to Github I get this error message: ``` Unable to clone code repository: fatal: ' ' is not a valid branch name hint: See `man ...
- How to use TS for creating appwrite func...
I was making a few appwrite functions but on doing the appwrite init setup process i always got main.js. Is there any way i can use TS?