You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I verified that the issue exists in the latest chatgpt release
Verify webapp is working
I verify that the ChatGPT webapp is working properly for this account.
Environment details
NodeJS v18.17.0
Ubuntu 22.04
Describe the Bug
Steps to Reproduce :
import { ChatGPTUnofficialProxyAPI } from "chatgpt";
const api = new ChatGPTUnofficialProxyAPI({
accessToken: "xxx",
apiReverseProxyUrl: "yyy",
});
Importing the module does not work in typescript backend, it seems to stem from some incompatibility the module has with cjs that typescript compiler spits out. Is there a way to go about this without reconfiguring the ts config? PS even that doesnt work.
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/bot/Desktop/Projects/Mains/studera-be/node_modules/chatgpt/build/index.js from /home/bot/Desktop/Projects/Mains/studera-be/utils/utils.ts not supported.
Instead change the require of index.js in /home/bot/Desktop/Projects/Mains/studera-be/utils/utils.ts to a dynamic import() which is available in all CommonJS modules.
at require.extensions. [as .js] (/home/bot/Desktop/Projects/Mains/studera-be/node_modules/ts-node/dist/index.js:851:20)
at Object. (/home/bot/Desktop/Projects/Mains/studera-be/utils/utils.ts:13:19)
at m._compile (/home/bot/Desktop/Projects/Mains/studera-be/node_modules/ts-node/dist/index.js:857:29)
...
The text was updated successfully, but these errors were encountered:
Verify latest release
chatgpt
releaseVerify webapp is working
Environment details
NodeJS v18.17.0
Ubuntu 22.04
Describe the Bug
Steps to Reproduce :
import { ChatGPTUnofficialProxyAPI } from "chatgpt";
const api = new ChatGPTUnofficialProxyAPI({
accessToken: "xxx",
apiReverseProxyUrl: "yyy",
});
Importing the module does not work in typescript backend, it seems to stem from some incompatibility the module has with cjs that typescript compiler spits out. Is there a way to go about this without reconfiguring the ts config? PS even that doesnt work.
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/bot/Desktop/Projects/Mains/studera-be/node_modules/chatgpt/build/index.js from /home/bot/Desktop/Projects/Mains/studera-be/utils/utils.ts not supported.
Instead change the require of index.js in /home/bot/Desktop/Projects/Mains/studera-be/utils/utils.ts to a dynamic import() which is available in all CommonJS modules.
at require.extensions. [as .js] (/home/bot/Desktop/Projects/Mains/studera-be/node_modules/ts-node/dist/index.js:851:20)
at Object. (/home/bot/Desktop/Projects/Mains/studera-be/utils/utils.ts:13:19)
at m._compile (/home/bot/Desktop/Projects/Mains/studera-be/node_modules/ts-node/dist/index.js:857:29)
...
The text was updated successfully, but these errors were encountered: