diff --git a/code/lib/channels/src/postmessage/index.ts b/code/lib/channels/src/postmessage/index.ts index 312a8d756295..a49997fc3d32 100644 --- a/code/lib/channels/src/postmessage/index.ts +++ b/code/lib/channels/src/postmessage/index.ts @@ -103,7 +103,7 @@ export class PostMessageTransport implements ChannelTransport { const frames = this.getFrames(target); - const query = qs.parse(location.search, { ignoreQueryPrefix: true }); + const query = qs.parse(location?.search || '', { ignoreQueryPrefix: true }); const data = stringify( {