Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'unsupported' #137

Closed
3 tasks done
dogukanakkaya opened this issue Dec 14, 2022 · 6 comments
Closed
3 tasks done

Cannot find module 'unsupported' #137

dogukanakkaya opened this issue Dec 14, 2022 · 6 comments

Comments

@dogukanakkaya
Copy link
Contributor

dogukanakkaya commented Dec 14, 2022

Verify latest release

  • 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.

Verify resrictions

  • I verify that I've double-checked all of the restrictions.

Environment details

Node.js Version 19.2,
Brave Browser
MacOS Monterey 12.5
M1 Chip

Link to the code that reproduces this issue

https://github.com/dogukanakkaya/chatgpt-code-vscode-extension

Describe the Bug

When you upgrade chatgpt-api to >=2.3.0 webpack errors

Cannot find module 'unsupported'

To Reproduce

to reproduce upgrade chatgpt-api module to >=2.3.0 and try to run the extension

Expected Behavior

It should work fine

Note

Might be related to something else but version 2.2.0 works just fine.

@transitive-bullshit
Copy link
Owner

Support for working in non-node.js environments was removed in v2.3.0 because of the browser / puppeteer dependency.

It's likely that the vscode / webpack config for your project was previously using the "browser" version of this package, but that's unfortunately no longer possible to support at the moment.

I'm working on a solution that won't require puppeteer to obtain auth credentials, but for now I don't think this use case is supported unless you can figure out how to run your vscode extension code in node.js.

@dogukanakkaya
Copy link
Contributor Author

I have an idea for a hacky workaround but since it's not an urgent requirement I'll keep using v2.2.0 until the solution you mention is here.

@timkmecl
Copy link
Contributor

@dogukanakkaya Would you mind telling me about this hacky workaround that you mentioned? I am having a similar problem with my vscode extension.

@dogukanakkaya
Copy link
Contributor Author

I was thinking about spinning a Node Server inside the extension and doing all the logic there. After that, communicate with that server via HTTP or whatever. But it's not ideal really, it will probably be slow and consume a lot of memory for a extension.

@dogukanakkaya
Copy link
Contributor Author

Seems like with v2.4.0 a browser version published but this issue continues to happen. I could not find the diff that affects that but v2.2.0 just works fine, there must be something between.

@dogukanakkaya dogukanakkaya reopened this Dec 15, 2022
@dogukanakkaya
Copy link
Contributor Author

Also seems like for VSCode extension development, we cannot upgrade above v2.2.0 because of Node >=18 requirement. For now latest VSCode runs Electron with Node 16 and this cannot be changed (microsoft/vscode#18253 (comment)).

cyhhao pushed a commit to cyhhao/chatgpt-api that referenced this issue Feb 8, 2023
…ix-token-freeze

🚑️ Fix if token expired, message will not send
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants