diff --git a/cli/plasmo/src/features/background-service-worker/bgsw-messaging.ts b/cli/plasmo/src/features/background-service-worker/bgsw-messaging.ts index 51df68cce..a44b4c07b 100644 --- a/cli/plasmo/src/features/background-service-worker/bgsw-messaging.ts +++ b/cli/plasmo/src/features/background-service-worker/bgsw-messaging.ts @@ -30,7 +30,7 @@ globalThis.__plasmoInternalPortMap = new Map() ${importSection} chrome.runtime.onMessageExternal.addListener((request, sender, sendResponse) => { - switch (request.name) { + switch (request?.name) { ${externalMessageSection} default: break