nodejs/cli-extension: resolving sdk paths and error log should be improved
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 127
Description
1. Doing like this will result error: `Error: Cannot find package '@github/copilot-sdk' imported from ...`
```ts
import { joinSession } from "@github/copilot-sdk/extension.js";
```
instead of..
```ts
import { joinSession } from "@github/copilot-sdk/extension";
```
(`.js` difference)
2. Error handling should be more improved, at CLI `v1.0.12`, it shows only single line not stacktrace etc, so hard to debug. e.g:
```
[INFO] Launching extension: /tmp/copilot/test/.github/extensions/test/extension.mjs
[INFO] [extension:/tmp/copilot/test/.github/extensions/test/extension.mjs] [extension-bootstrap] Failed to load extension: SyntaxError: Unexpected token 'export'
[INFO] Extension exited: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
[ERROR] Extension failed during startup: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
```
```
[INFO] Found 1 extension(s), launching 1 (0 disabled)
[INFO] Launching extension: /tmp/copilot/test/.github/extensions/test/extension.mjs
[INFO] [extension:/tmp/copilot/test/.github/extensions/test/extension.mjs] [extension-bootstrap] Failed to load extension: Error: Invalid package config /tmp/copilot/test/.github/extensions/test/package.json.
[INFO] Extension exited: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
[ERROR] Extension failed during startup: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
```
Contributor guide
Assessment
This issue has not been assessed yet.