I recently installed cloudinary via npm and cannot import it in my nodeJS backend due to the following error.
(base) feiwu@Feis-MacBook-Pro backend % node server.js
/Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:1168
var useAgent = navigator && navigator.userAgent || '';
^
ReferenceError: navigator is not defined
at Module../src/namespace/cloudinary-core.js (/Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:1168:16)
at __webpack_require__ (/Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:37:30)
at /Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:101:18
at /Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:104:10
at webpackUniversalModuleDefinition (/Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:10:20)
at Object.<anonymous> (/Users/feiwu/projects/inventaire/backend/node_modules/cloudinary-core/cloudinary-core.js:17:3)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/feiwu/projects/inventaire/backend/node_modules/cloudinary/lib/utils/index.js:48:57)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
I have found nothing so far about this error and would like to know if someone know about this issue ?
CodePudding user response:
Started happening to me around 15 hours ago as well.
CodePudding user response:
Cloudinary had just released a new version to its JS SDK (version 2.12.2) that fixes this issue.
CodePudding user response:
This error is from cloudinary's end. Fix this error with npm i cloudinary-core.
CodePudding user response:
installing cloudinary-core helped me get rid of this error
npm i cloudinary-core
CodePudding user response:
This issue was introduced recently in Cloudinary version 1.28.0.
https://www.npmjs.com/package/cloudinary/v/1.28.0
The issue reported on github here : https://github.com/cloudinary/cloudinary_npm/issues/524
I was able to fix this issue by pointing cloudinary to 1.27.1
"cloudinary": "1.27.1"
Cloudinary guys have fixed this issue here : https://github.com/cloudinary/cloudinary_js/pull/281.