Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages using workers causing 'Module not found ../worker.ts' #154

Open
restspace opened this issue Nov 14, 2024 · 0 comments
Open

Packages using workers causing 'Module not found ../worker.ts' #154

restspace opened this issue Nov 14, 2024 · 0 comments

Comments

@restspace
Copy link

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.

@restspace restspace changed the title Packages using workers causing problems Packages using workers causing 'Module not found ../worker.ts' Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant