Skip to content

Commit

Permalink
fix: worker instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlwn123 committed Sep 20, 2024
1 parent 632e02b commit 4f20b2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core-web/src/transport/WorkerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class WorkerClient {

constructor() {
// Must create the URL inside the constructor for vite
this.worker = new Worker(new URL('./worker.js', import.meta.url), {
this.worker = new Worker(new URL('../worker.js', import.meta.url), {
type: 'module',
})
this.worker.onmessage = this.handleWorkerMessage.bind(this)
Expand All @@ -31,7 +31,7 @@ export class WorkerClient {
}

private handleWorkerError(event: ErrorEvent) {
console.error('Worker error', event)
console.error('Worker error', JSON.stringify(event))
}

private handleWorkerMessage(event: MessageEvent) {
Expand Down

0 comments on commit 4f20b2f

Please sign in to comment.