Rank 2: Process
Hello guys, i just installed a javascript libary to my cloud function project and now i'm getting this error
Votes
0
Replies
12
Participants
Unknown
Messages
13
Rank 2: Process
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
Rank 2: Process
here is the package.json
remove this "type": "module" from your package.json and try again
Rank 2: Process
okay
also can you show the main.js file
Rank 2: Process
now, i'm getting this
Rank 2: Process
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
Rank 2: Process
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