Hi,
I run into an issue using transform() API.
When I run this example code :
(async () => {
const ts = `
export const value: number = 1;
`;
const esbuild = require("esbuild");
const service = await esbuild.startService();
try {
const { js } = await service.transform(ts, { loader: "ts" });
console.log(js);
} catch (err) {
console.error(err);
}
service.stop();
})();
I have the following error :
Error: Transform failed with 1 error
at failureErrorWithLog (...\node_modules\esbuild\lib\main.js:35:17)
at Object.transform (...\node_modules\esbuild\lib\main.js:250:38)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async ...\es.js:10:20 {
errors: [
{ text: 'Could not read from file: E:\\input.ts', location: null }
],
warnings: []
}
If I create a ts file and call the CLI command npx esbuild
, it works properly.
I'm on Windows 10, using Node v12.16.3.
Same here
Thanks for the report! I think I know why this happens. Will fix as soon as I can download a Windows VM for testing.
Most helpful comment
Thanks for the report! I think I know why this happens. Will fix as soon as I can download a Windows VM for testing.