Skip to content

Commit 6349ade

Browse files
committed
Fixed some loading issues with react-native.
1 parent fa079d2 commit 6349ade

5 files changed

+4
-5
lines changed

packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class BrowserGlobalHandlerPlugin implements IEventPlugin {
1313
private _client: ExceptionlessClient | null = null;
1414

1515
public startup(context: PluginContext): Promise<void> {
16-
if (this._client) {
16+
if (this._client || typeof window !== "object") {
1717
return Promise.resolve();
1818
}
1919

packages/browser/src/plugins/BrowserLifeCyclePlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class BrowserLifeCyclePlugin implements IEventPlugin {
1111
private _client: ExceptionlessClient | null = null;
1212

1313
public startup(context: PluginContext): Promise<void> {
14-
if (this._client) {
14+
if (this._client || typeof document !== "object") {
1515
return Promise.resolve();
1616
}
1717

packages/browser/src/plugins/BrowserModuleInfoPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class BrowserModuleInfoPlugin implements IEventPlugin {
3030
}
3131

3232
private getModules(): ModuleInfo[] | undefined {
33-
if (!document || !document.getElementsByTagName) {
33+
if (typeof document !== "object" || !document.getElementsByTagName) {
3434
return;
3535
}
3636

packages/browser/src/plugins/BrowserRequestInfoPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class BrowserRequestInfoPlugin implements IEventPlugin {
2929
}
3030

3131
private getRequestInfo(context: EventPluginContext): RequestInfo | undefined {
32-
if (!document || !navigator || !location) {
32+
if (typeof document !== "object" || typeof navigator !== "object" || typeof location !== "object") {
3333
return;
3434
}
3535

packages/browser/src/plugins/BrowserWrapFunctions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export class BrowserWrapFunctions implements IEventPlugin {
1818
this._client = context.client;
1919

2020
// TODO: TraceKit.extendToAsynchronousCallbacks();
21-
2221
return Promise.resolve();
2322
}
2423
}

0 commit comments

Comments
 (0)