- stack trace: Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/my_app/node_modules/p-queue/dist/index.js from /Users/my_app/node_modules/@ibm-generative-ai/node-sdk/dist/index.cjs not supported.
Instead change the require of index.js in /Users/my_app/node_modules/@ibm-generative-ai/node-sdk/dist/index.cjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/my_app/node_modules/@ibm-generative-ai/node-sdk/dist/index.cjs:230:30)
at Object.<anonymous> (/Users/my_app/watsonx/promptLLM.js:10:16)
at Object.<anonymous> (/Users/my_app/routes/genai_service.js:39:24)
at /Users/my_app/node_modules/bhendi/mw/dispatcher.js:193:47
at async Promise.all (index 2)
at async /Users/my_app/node_modules/bhendi/mw/dispatcher.js:123:13
at async Promise.all (index 0)
at async /Users/my_app/node_modules/bhendi/mw/dispatcher.js:109:9
at async Promise.all (index 0)
at async Object.registerRoutes (/Users/my_app/node_modules/bhendi/mw/dispatcher.js:72:5)
at async Object.init (/Users/my_app/node_modules/bhendi/bhendi.js:471:20)
at async startServer (/Users/my_app/app.js:66:25)
Using the latest version
2.0.2
and the require way of using the library is not working.const Client = require('@ibm-generative-ai/node-sdk').Client
Thanks!