From e7873df31ba490edd3d2b32173a4ad51f41a3afa Mon Sep 17 00:00:00 2001 From: Sunil Pai Date: Mon, 24 Jan 2022 21:57:12 +0000 Subject: [PATCH] Update .changeset/popular-weeks-march.md Co-authored-by: Pete Bacon Darwin --- .changeset/popular-weeks-march.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/popular-weeks-march.md b/.changeset/popular-weeks-march.md index 030859340f90..bb389d515502 100644 --- a/.changeset/popular-weeks-march.md +++ b/.changeset/popular-weeks-march.md @@ -4,6 +4,6 @@ fix: use entrypoint specified in esbuuild's metafile as source for building the worker -When we pass a non-js file as entry to esbuild, it generates a `.js` file. (which, that's the whole job of esbuild, haha). So, given `/index.ts`, it'll generate `/index.js`. However, when we try to 'find' the matching file to pass on as an input to creating the actual worker, we try to use the original file name inside the destination directory. At this point, the extension has changed, so it doesn't find the file, and hence we get the error that looks like `ENOENT: no such file or directory, open '/var/folders/3f/fwp6mt7n13bfnkd5vl3jmh1w0000gp/T/tmp-61545-4Y5kwyNI8DGU/src/worker.ts'` +When we pass a non-js file as entry to esbuild, it generates a `.js` file. (which, is the whole job of esbuild, haha). So, given `/index.ts`, it'll generate `/index.js`. However, when we try to 'find' the matching file to pass on as an input to creating the actual worker, we try to use the original file name inside the destination directory. At this point, the extension has changed, so it doesn't find the file, and hence we get the error that looks like `ENOENT: no such file or directory, open '/var/folders/3f/fwp6mt7n13bfnkd5vl3jmh1w0000gp/T/tmp-61545-4Y5kwyNI8DGU/src/worker.ts'` The actual path to the destination file is actually the key of the block in `metafile.outputs` that matches the given output.entryPoint, so this PR simply rewrites the logic to use that instead.