Skip to content

Commit

Permalink
Update __dirname variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Jul 16, 2024
1 parent 7d2e380 commit 58d5bf7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/vite/src/rsc/rscWorkerCommunication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ import { Worker } from 'node:worker_threads'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'

import type { RscFetchProps } from './rscFetchForClientRouter.js'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const worker = new Worker(path.join(__dirname, 'rscWorker.js'), {

const workerPath = path.join(
// __dirname. Use fileURLToPath for windows compatibility
path.dirname(fileURLToPath(import.meta.url)),
'rscWorker.js',
)

const worker = new Worker(workerPath, {
execArgv: [
'--conditions',
'react-server',
Expand Down

0 comments on commit 58d5bf7

Please sign in to comment.