File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ import { Installation } from "../../installation"
1313import { PushRelay } from "../../server/push-relay"
1414import { Log } from "../../util"
1515import { Global } from "../../global"
16- import * as QRCode from "qrcode"
16+ // dynamic import: static `import * as` of CJS package triggers Bun bundler splitting bug
17+ import type * as QRCodeType from "qrcode"
1718
1819const log = Log . create ( { service : "serve" } )
1920
@@ -184,6 +185,7 @@ async function printPairQR(pair: PairPayload) {
184185 linkLength : link . length ,
185186 qr : qrConfig ,
186187 } )
188+ const QRCode : typeof QRCodeType = await import ( "qrcode" )
187189 const code = await QRCode . toString ( link , {
188190 ...qrConfig ,
189191 } )
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ import { errors } from "../../error"
1717import { lazy } from "@/util/lazy"
1818import { Effect , Option } from "effect"
1919import { PushRelay } from "../../push-relay"
20- import * as QRCode from "qrcode"
20+ // dynamic import: static `import * as` of CJS package triggers Bun bundler splitting bug
21+ import type * as QRCodeType from "qrcode"
2122import { Agent } from "@/agent/agent"
2223import { jsonRequest , runRequest } from "./trace"
2324
@@ -60,6 +61,7 @@ function pushPairLink(input: { relaySecret: string; hosts: string[] }) {
6061}
6162
6263async function pushPairQRCode ( input : { relaySecret : string ; hosts : string [ ] } ) {
64+ const QRCode : typeof QRCodeType = await import ( "qrcode" )
6365 return QRCode . toDataURL ( pushPairLink ( input ) , pushPairQROptions )
6466}
6567
Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ export const Event = {
246246 "session.error" ,
247247 z . object ( {
248248 sessionID : SessionID . zod . optional ( ) ,
249- error : MessageV2 . Assistant . shape . error ,
249+ // z.lazy defers access to break circular dep: session → message-v2 → provider → plugin → session
250+ error : z . lazy ( ( ) => MessageV2 . Assistant . shape . error ) ,
250251 } ) ,
251252 ) ,
252253}
You can’t perform that action at this time.
0 commit comments