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

Module not found: Error: Default condition should be last one #1

Open
manestream opened this issue Dec 4, 2022 · 8 comments
Open

Comments

@manestream
Copy link

manestream commented Dec 4, 2022

Hey Marcel,

first of all, thanks a lot for this repo and your idea. This is really awesome.

I cloned your repository and tried to set it up locally but somehow webpack is not able to resolve the chatgpt module, albeit it has been installed and can be found by vscode and within the node_modules.

Steps to reproduce:

  1. Clone the repository
  2. cd to folder
  3. yarn install
  4. Start vscode from that folder
  5. Press f5 for a debugging session

I see the extension in the tab in the Extension Development Ide, but when i click i get the error in the logs:

Module not found: Error: Default condition should be last one

i get the same error when i try to compile with yarn compile

Versions:
macos: 12.5.1
vscode: Version: 1.73.1, Commit: 6261075646f055b99068d3688932416f2346dd3b
yarn: 1.22.11
node: v16.13.2

thanks a lot in advance!

@andreseichi
Copy link

Having the same issue

@ashhama
Copy link

ashhama commented Dec 4, 2022

Same Issue here

@georgewashtol
Copy link

Same issue

@pistachiomatt
Copy link

Have the same issue. I think the issue is the compiled code is generating unreachable code but I haven't looked deeper into it.

@abi
Copy link

abi commented Dec 5, 2022

The source of the issue is the https://github.com/transitive-bullshit/chatgpt-api repo. I haven't found a solution yet.

@abi
Copy link

abi commented Dec 5, 2022

I built the chatgpt-api repo separately, then inlined it into this repo and everything works. So, still not sure what the root cause is but at least it works now.

For anyone who wants to just run it, checkout https://github.com/abi/chatgpt-vscode/commits/main

@ghost
Copy link

ghost commented Dec 5, 2022

In order to make it work, I modified the exports property of node_modules\chatgpt\package.json, like this (I moved the default property to be the last one in the object):
"exports": { "import": "./build/index.js", "types": "./build/index.d.ts", "default": "./build/index.js" },

After that, I was able to run vsce package successfully.

@timkmecl
Copy link
Contributor

timkmecl commented Dec 6, 2022

They solved this in v1.2.2 of the chatgpt-api. However, v1.0.0 introduces some breaking changes so the code of this repo doesn't work anymore

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

7 participants