From e0bfc3f336b380dc438d04733f24b1378e23bcad Mon Sep 17 00:00:00 2001 From: diegodelrieue Date: Mon, 22 Apr 2024 15:54:51 +0200 Subject: [PATCH] fix: pass correct chrome connct instance --- examples/with-plasmo/src/contents/content.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/with-plasmo/src/contents/content.ts b/examples/with-plasmo/src/contents/content.ts index 30d931a..a569e6f 100644 --- a/examples/with-plasmo/src/contents/content.ts +++ b/examples/with-plasmo/src/contents/content.ts @@ -1,8 +1,11 @@ import { relay } from 'trpc-browser/relay'; import { autoConnect } from 'trpc-browser/shared/chrome'; -void autoConnect(chrome, (port) => { - return relay(window, port); // return so it has the cleanup function for disconnect -}).then(() => { +void autoConnect( + () => chrome.runtime.connect(), + (port) => { + return relay(window, port); // return so it has the cleanup function for disconnect + }, +).then(() => { return console.log('Content script loaded - bridge initialized'); });