Skip to content

Commit

Permalink
Update .changeset/popular-weeks-march.md
Browse files Browse the repository at this point in the history
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
  • Loading branch information
threepointone and petebacondarwin committed Jan 24, 2022
1 parent ddf3376 commit e7873df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .changeset/popular-weeks-march.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<source>/index.ts`, it'll generate `<destination>/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 `<source>/index.ts`, it'll generate `<destination>/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.

0 comments on commit e7873df

Please sign in to comment.