Skip to content

Commit 0788183

Browse files
continue[bot]Continue
andcommitted
Fix bundling issue by extracting error tracking to separate module
Move hasUnhandledError flag and functions to errorTracking.ts to avoid circular dependency issues when bundling. This fixes the syntax error that was occurring when the bundler tried to handle imports from the entry point (index.ts). Fixes: SyntaxError: Unexpected reserved word in bundled code Co-authored-by: peter-parker <[email protected]> Generated with Continue (https://continue.dev) Co-Authored-By: Continue <[email protected]>
1 parent 059f232 commit 0788183

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Error tracking module for CLI
3+
* Tracks whether any unhandled errors occurred during execution
4+
*/
5+
6+
// Track whether any unhandled errors occurred during execution
7+
let hasUnhandledError = false;
8+
9+
/**
10+
* Mark that an unhandled error has occurred
11+
*/
12+
export function markUnhandledError(): void {
13+
hasUnhandledError = true;
14+
}
15+
16+
/**
17+
* Check if any unhandled errors occurred during execution
18+
*/
19+
export function hadUnhandledError(): boolean {
20+
return hasUnhandledError;
21+
}

extensions/cli/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "./init.js";
66
import { Command } from "commander";
77

88
import { chat } from "./commands/chat.js";
9+
import { markUnhandledError } from "./errorTracking.js";
910
import { login } from "./commands/login.js";
1011
import { logout } from "./commands/logout.js";
1112
import { listSessionsCommand } from "./commands/ls.js";

extensions/cli/src/util/exit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ChatHistoryItem } from "core/index.js";
22

3-
import { hadUnhandledError } from "./errorTracking.js";
3+
import { hadUnhandledError } from "../errorTracking.js";
44
import { sentryService } from "../sentry.js";
55
import { getSessionUsage } from "../session.js";
66
import { telemetryService } from "../telemetry/telemetryService.js";

0 commit comments

Comments
 (0)