From 1058d0dee4f745bca486d1fbcabc6b330c893b58 Mon Sep 17 00:00:00 2001 From: Ali Date: Sun, 27 Jul 2025 06:31:45 +0300 Subject: [PATCH] fix import.meta.url in hmr (#21386) ### What does this PR do? use `window.location.origin` in browser instead of `bun://` . should fix [9910](https://github.com/oven-sh/bun/issues/19910) - [ ] Documentation or TypeScript types (it's okay to leave the rest blank in this case) - [x] Code changes ### How did you verify your code works? --- src/bake/hmr-module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bake/hmr-module.ts b/src/bake/hmr-module.ts index 8c8b666eb3..aab0127dfa 100644 --- a/src/bake/hmr-module.ts +++ b/src/bake/hmr-module.ts @@ -147,7 +147,7 @@ export class HMRModule { get importMeta() { const importMeta = { - url: `bun://${this.id}`, + url: `${location.origin}/${this.id}`, main: false, require: this.require.bind(this), // transpiler rewrites `import.meta.hot.*` to access `HMRModule.*`