evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
37.94k stars 1.13k forks source link

Transform doesn't seem to be honoring initialization worker: false #3694

Closed mcgear closed 5 months ago

mcgear commented 6 months ago

I am trying to use an app on Deno Deploy, but even with


      await esbuild.initialize({
        worker: false,
      });

I get an error when esbuild.transform is used. Does transform work with the worker false?

evanw commented 6 months ago

You didn't follow the issue reporting instructions because there is no way to reproduce your issue. I tried to reproduce it myself using esbuild's instructions for Deno along with your code and could not reproduce it:

$ cat example.js
import * as esbuild from 'https://deno.land/x/esbuild@v0.20.1/wasm.js'
await esbuild.initialize({
  worker: false,
})
let ts = 'let test: boolean = true'
let result = await esbuild.transform(ts, { loader: 'ts' })
console.log('result:', result)
await esbuild.stop()

$ deno run --allow-net example.js
result: {
  warnings: [],
  code: "let test = true;\n",
  map: "",
  mangleCache: undefined,
  legalComments: undefined
}

Marking this issue as unactionable because there is insufficient information here. This issue will be closed if sufficient information is not provided.

evanw commented 5 months ago

Closing due to lack of information.