Background:
The issue you are facing is due to the dependency of Clarifai JS on axios for requests. Throughout the development of the Clarifai, the library has accepted multiple versions of axios but haven't really configured compatibility on these versions.
Ex.
Clarifai is familiar with axios v1.1.2 but there is no compatibility for it to work in a good condition and perform well with the library.
To solve this issue:
- In your package.json file, update "axios" under "dependencies" to "0.27.2" (The compatible version as of now).
- Add an "overrides" section and include the code below (Overrides Section).
- Reinstall your node_modules folder (run 'npm install')
(in 'package.json')
"dependencies": {
...
"axios": "0.27.2",
"clarifai": "^2.9.1",
...
},
"overrides": {
"clarifai": {
"axios": "$axios"
}
},
...