You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project https://github.com/restspace/rs-runtime makes use of two packages which use workers: https://deno.land/x/denomailer@1.6.0 https://deno.land/x/bcrypt@v0.2.4
These and I imagine any other package using workers will break the bundle made using this library right now as the package when run will look for a file such as worker.ts in the directory with the bundled file and it won't be there. deno bundle used to deal with this by pointing the code to the url where the package library hosts the worker.ts file, substituting this url for import.meta.url in the expression URL('worker.ts', import.meta.url) which these packages are almost certain to use to get the url of the worker file.
Could some functionality like this be added to esbuild_deno_loader?
As a workaround I'm using a script to do a hardcoded find and replace on the bundle file to do exactly this.
The text was updated successfully, but these errors were encountered:
restspace
changed the title
Packages using workers causing problems
Packages using workers causing 'Module not found ../worker.ts'
Nov 14, 2024
My project https://github.com/restspace/rs-runtime makes use of two packages which use workers:
https://deno.land/x/denomailer@1.6.0
https://deno.land/x/bcrypt@v0.2.4
These and I imagine any other package using workers will break the bundle made using this library right now as the package when run will look for a file such as
worker.ts
in the directory with the bundled file and it won't be there.deno bundle
used to deal with this by pointing the code to the url where the package library hosts theworker.ts
file, substituting this url forimport.meta.url
in the expressionURL('worker.ts', import.meta.url)
which these packages are almost certain to use to get the url of the worker file.Could some functionality like this be added to esbuild_deno_loader?
As a workaround I'm using a script to do a hardcoded find and replace on the bundle file to do exactly this.
The text was updated successfully, but these errors were encountered: