TabbyML / tabby

Self-hosted AI coding assistant
https://tabbyml.com
Other
21.9k stars 998 forks source link

[intellij plugin] Get error when initializing Tabby #2688

Closed jerryion closed 4 months ago

jerryion commented 4 months ago

Log from console:

Exception in thread "DefaultDispatcher-worker-34 @coroutine#1612" org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request initialize failed with message: spawnSync **\tabby\clients\intellij\build\idea-sandbox\plugins\intellij-tabby\tabby-agent\node\win-ca\roots.exe ENOENT

Is it caused by some missing setup?

icycodes commented 4 months ago

Hi, @jerryion, It looks like you're trying to build and run the Tabby IntelliJ plugin from source. Here are some thoughts that might help you address the problem.

The log you posted indicates that win-ca\roots.exe was not found. This file is used by tabby-agent to load system-wide CA settings on Windows. Normally, it should be copied from tabby-agent into the sandbox by the Gradle build script.

You can try to run pnpm turbo build in clients/tabby-agent, check the output in the dist to ensure that this file is present.

jerryion commented 4 months ago

Hey @icycodes , thanks for you quick reply. Yes, I am trying to build and run the tabby intellij plugin from source. Here is the output of executing pnpm turbo build

$ pnpm turbo build

Update available v1.13.3 ≫ v2.0.7
Changelog: https://github.com/vercel/turbo/releases/tag/v2.0.7
Run "npx @turbo/codemod@latest update" to update

Follow @turborepo for updates: https://x.com/turborepo
• Packages in scope: tabby-agent
• Running build in 1 packages
• Remote caching disabled
tabby-agent:build: cache hit, replaying logs 2004893ff6226f9b
tabby-agent:build:
tabby-agent:build: > tabby-agent@1.8.0-dev build **\tabby\clients\tabby-agent
tabby-agent:build: > tsc --noEmit && tsup --minify
tabby-agent:build:
tabby-agent:build: [LSP-PROTOCOL] CLI Building entry: src/lsp/protocol.ts
tabby-agent:build: [LSP-PROTOCOL] CLI Using tsconfig: tsconfig.json
tabby-agent:build: [LSP-PROTOCOL] CLI tsup v8.0.2
tabby-agent:build: [LSP-PROTOCOL] CLI Using tsup config: **\tabby\clients\tabby-agent\tsup.config.ts
tabby-agent:build: [LSP-NODE] CLI Building entry: src/lsp/index.ts
tabby-agent:build: [LSP-NODE] CLI Using tsconfig: tsconfig.json
tabby-agent:build: [LSP-NODE] CLI tsup v8.0.2
tabby-agent:build: [LSP-NODE] CLI Using tsup config: **\tabby\clients\tabby-agent\tsup.config.ts
tabby-agent:build: [LSP-BROWSER] CLI Building entry: src/lsp/index.ts
tabby-agent:build: [LSP-BROWSER] CLI Using tsconfig: tsconfig.json
tabby-agent:build: [LSP-BROWSER] CLI tsup v8.0.2
tabby-agent:build: [LSP-BROWSER] CLI Using tsup config: **\tabby\clients\tabby-agent\tsup.config.ts
tabby-agent:build: [LSP-NODE] CLI Target: node18
tabby-agent:build: [LSP-PROTOCOL] CLI Target: es2020
tabby-agent:build: [LSP-PROTOCOL] CJS Build start
tabby-agent:build: [LSP-BROWSER] CLI Target: es2020
tabby-agent:build: [LSP-NODE] CLI Cleaning output folder
tabby-agent:build: [LSP-NODE] CJS Build start
tabby-agent:build: [LSP-BROWSER] CLI Cleaning output folder
tabby-agent:build: [LSP-BROWSER] ESM Build start
tabby-agent:build: [LSP-PROTOCOL] CJS dist\protocol.js 6.16 KB
tabby-agent:build: [LSP-PROTOCOL] CJS ⚡️ Build success in 68ms
tabby-agent:build: [LSP-PROTOCOL] DTS Build start
tabby-agent:build: [LSP-PROTOCOL] DTS ⚡️ Build success in 1369ms
tabby-agent:build: [LSP-PROTOCOL] DTS dist\protocol.d.ts 25.44 KB
tabby-agent:build:
tabby-agent:build:  WARN  ▲ [WARNING] Import "setDefaultResultOrder" will always be undefined because there is no matching export in "../../node_modules/.pnpm/esbuild-plugin-polyfill-node@0.3.0_esbuild@0.19.12/node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js" [import-is-undefined]
tabby-agent:build:
tabby-agent:build:     src/lsp/index.ts:9:6:
tabby-agent:build:       9 │   dns.setDefaultResultOrder("ipv4first");
tabby-agent:build:         ╵       ~~~~~~~~~~~~~~~~~~~~~
tabby-agent:build:
tabby-agent:build:
tabby-agent:build:
tabby-agent:build: [LSP-BROWSER] ESM dist\browser\index.mjs     661.22 KB
tabby-agent:build: [LSP-BROWSER] ESM dist\browser\index.mjs.map 2.79 MB
tabby-agent:build: [LSP-BROWSER] ESM ⚡️ Build success in 8493ms
tabby-agent:build: [LSP-NODE] CJS dist\node\crypt32-x64-DGNGT7PC.node  115.00 KB
tabby-agent:build: [LSP-NODE] CJS dist\node\crypt32-ia32-ICQ243Y3.node 90.50 KB
tabby-agent:build: [LSP-NODE] CJS dist\node\index.js                   1.01 MB
tabby-agent:build: [LSP-NODE] CJS dist\node\index.js.map               4.45 MB
tabby-agent:build: [LSP-NODE] CJS ⚡️ Build success in 8496ms

 Tasks:    1 successful, 1 total
Cached:    1 cached, 1 total
  Time:    1.726s >>> FULL TURBO

And there is no win-ca\roots.exe after the command executed

icycodes commented 4 months ago

The crypt32-x64-DGNGT7PC.node and crypt32-ia32-ICQ243Y3.node files should be skipped, but they are being copied. It seems the build script in tsup.config is not working properly. Have you made any modifications related to this?

Alternatively, it may be caused by turbo using a stale cache. You can try to clean the turbo cache or running pnpm turbo build --force to ignore the cache.

jerryion commented 4 months ago

Nope. I just

jerryion commented 4 months ago

@icycodes I repeated these steps above on my mac. They worked fine and the plugin successfully initialized & connected to server. I noted that there are some warning when running pnpm install

Failed to create bin at /Users/pumpkinyang/development/demos/tabby/node_modules/.pnpm/node_modules/.bin/tabby-agent. ENOENT: no such file or directory, open '/Users/pumpkinyang/development/demos/tabby/node_modules/.pnpm/node_modules/tabby-agent/dist/node/index.js'
Failed to create bin at /Users/pumpkinyang/development/demos/tabby/clients/intellij/node_modules/.bin/tabby-agent. ENOENT: no such file or directory, open '/Users/pumpkinyang/development/demos/tabby/clients/tabby-agent/dist/node/index.js'
 WARN  Failed to create bin at /Users/pumpkinyang/development/demos/tabby/clients/vscode/node_modules/.bin/tabby-agent. ENOENT: no such file or directory, open '/Users/pumpkinyang/development/demos/tabby/clients/tabby-agent/dist/node/index.js'
 WARN  Failed to create bin at /Users/pumpkinyang/development/demos/tabby/clients/intellij/node_modules/.bin/tabby-agent. ENOENT: no such file or directory, open '/Users/pumpkinyang/development/demos/tabby/clients/intellij/node_modules/tabby-agent/dist/node/index.js'
 WARN  Failed to create bin at /Users/pumpkinyang/development/demos/tabby/clients/vscode/node_modules/.bin/tabby-agent. ENOENT: no such file or directory, open '/Users/pumpkinyang/development/demos/tabby/clients/vscode/node_modules/tabby-agent/dist/node/index.js'

Are they related to this issue?

jerryion commented 4 months ago

@icycodes so far I met this issue with v1.6.x on my windows PC(for v1.4.0 there are no problems)

icycodes commented 4 months ago

@icycodes so far I met this issue with v1.6.x on my windows PC(for v1.4.0 there are no problems)

It seems the problem might be related to the regex pattern in the tsup.config, which does not handle Windows paths correctly.

jerryion commented 4 months ago

@icycodes so far I met this issue with v1.6.x on my windows PC(for v1.4.0 there are no problems)

It seems the problem might be related to the regex pattern in the tsup.config, which does not handle Windows paths correctly.

Thanks for your hard work. I will update the codebase and try again once your fix merged.

icycodes commented 4 months ago

@icycodes so far I met this issue with v1.6.x on my windows PC(for v1.4.0 there are no problems)

It seems the problem might be related to the regex pattern in the tsup.config, which does not handle Windows paths correctly.

Thanks for your hard work. I will update the codebase and try again once your fix merged.

The fix has been merged into the main branch. You can test it out on the main branch. If you want to apply it to release-intellij-1.6, you may need to cherry-pick the changes locally.

jerryion commented 4 months ago

@icycodes so far I met this issue with v1.6.x on my windows PC(for v1.4.0 there are no problems)

It seems the problem might be related to the regex pattern in the tsup.config, which does not handle Windows paths correctly.

Thanks for your hard work. I will update the codebase and try again once your fix merged.

The fix has been merged into the main branch. You can test it out on the main branch. If you want to apply it to release-intellij-1.6, you may need to cherry-pick the changes locally.

Just tested it on main branch and worked fine! Thanks! @icycodes