andywer/threads-plugin

Use threads-plugin with SSR

開放

#8 建立於 2019年10月11日

 (8 則留言) (0 個反應) (0 位負責人)JavaScript (5 個分叉)github user discovery
help wanted

倉庫指標

星標
 (29 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Hi,

I am getting an error when I try to use the loader in SSR.

Captura de pantalla 2019-10-11 a las 11 34 29

Basically the loader is creating a new file from my worker called 0.worker.js and putting it in the folder where the server code has been compiled.

However, when I try to run this code,

  const greeter = await spawn(new Worker('./worker'))
  const {response} = await greeter({name: 'Carlos'})
  console.log(response)
  await Thread.terminate(greeter)

I get the error.

Any suggestions ?!

Thx!

Carlos

貢獻者指南