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
- Function domain not available
Hello, even tho in docs you clearly describe that every function has its domain, I can not see it anywhere in any of my projects. How do I reveal the url of th...
- Inquiry: How to Reduce Cold Start Durati...
Hey! I was using Python for the function runtime, but after reading that Go has the fastest runtime, I switched my code over to Go. However, I'm still seeing co...
- context deadline exceeded
Hi, in one of my projects i continuously receive context deadline exceeded when trying to reach users API from my local machine: https://fra.cloud.appwrite.io/v...