#1342·plasmo

[BUG] Relay TypeError: 无法读取 undefined 的属性 (读取 '56' ) 在 nanoid 库中

作者: duylddev创建于 2026年1月18日更新于 2026年1月18日
标签bug

发生了什么问题?

在主世界中:

sendToBackgroundViaRelay<undefined, { message: string }>({ name: "ping" }) .then((rs) => { console.log( Ping sent to background successfully", rs) }) .catch((err) => { console.error(" Ping sent to background failed", err) })

在 relay.ts 中:

relayMessage({ name: "ping" }) 错误日志:

Ping sent to background failed TypeError: Cannot read properties of undefined (reading '56') at nanoid (index.browser.js:28:10) at index.js:1:967 at new Promise () at y (index.js:1:922) at 1QIWJ.@parcel/Transformer-js/src/esmodule-helpers.js (interceptor.ts:13:66) at newRequire (interceptor.c6e920dd.js:72:24) at interceptor.c6e920dd.js:123:5 at runtime-64301f64d4baff50.js:1:1 at index.browser.js:29:1

内容来源: PlasmoHQ/plasmo