From 4cbd4ef9913d9d167eec7dda029f4fe6f3b22bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 13 Dec 2024 18:04:44 +0100 Subject: [PATCH] js/esbuild: Batch: Avoid nil Instances slice Ranging over a nil slice in Go works great, but is a hassle onced passed to JS. --- internal/js/esbuild/batch.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/js/esbuild/batch.go b/internal/js/esbuild/batch.go index 1a8a7b09a..688b58d21 100644 --- a/internal/js/esbuild/batch.go +++ b/internal/js/esbuild/batch.go @@ -506,8 +506,9 @@ func (b *batcher) doBuild(ctx context.Context) (*Package, error) { }) bt := scriptBatchTemplateContext{ - opts: vv, - Import: impPath, + opts: vv, + Import: impPath, + Instances: []scriptInstanceBatchTemplateContext{}, } state.importResource.Set(bt.Import, vv.Compiled().Resource) predicate := func(k instanceID) bool {