Skip to content

Commit 7702b45

Browse files
committed
Fixed node runtime issue with calling c.useLocalStorage() on startup
1 parent 48a0b59 commit 7702b45

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/queue/DefaultEventQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class DefaultEventQueue implements IEventQueue {
7676
}
7777

7878
const file = await this.enqueueEvent(event);
79-
const logText = `type=${<string>event.type} reference_id=${event.reference_id ?? "<null>"} source=${<string>event.source} message=${<string>event.message}`;
79+
const logText = `type=${<string>event.type} reference_id=${<string>event.reference_id} source=${<string>event.source} message=${<string>event.message}`;
8080
log.info(`Enqueued event: ${file} (${logText})`);
8181
}
8282

packages/node/src/NodeExceptionlessClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export class NodeExceptionlessClient extends ExceptionlessClient {
2222

2323
if (configurationOrApiKey) {
2424
if (!globalThis?.localStorage) {
25-
config.services.storage = new LocalStorage(undefined, new LocalStoragePolyfill(process.cwd() + '/.exceptionless'));
25+
const storage = new LocalStorage(undefined, new LocalStoragePolyfill(process.cwd() + '/.exceptionless'));
26+
config.useLocalStorage = () => storage;
27+
config.services.storage = storage;
2628
}
2729

2830
if (!globalThis?.fetch) {

0 commit comments

Comments
 (0)