Skip to content

webpack electron react issues #36

@ghost

Description

expose() called in the master thread.

I believe the issue is since its compiling my electron main file and the worker file all in one file it's yelling at me since its all on the master thread or am i incorrect?

main.ts

async function test() {
  const auth = await spawn(new Worker("./workers/worker.ts", { type: 'module' }))
  const hashed = await auth.hashPassword("Super secret password", "1234")
   
  console.log("Hashed password:", hashed)
  await Thread.terminate(auth)
}

test().catch(console.error)

worker.ts

import { expose } from "threads/worker";

export const newtest = () => { console.log('creating file') }

const hashPassword = (testm, ag) => {
  return 'yes running'
}

expose(hashPassword)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions