{"record":{"id":"3967f9ff58938844","repo":"gohugoio/hugo","slug":"esbuild-entry-point-output-not-found","errorCode":null,"errorMessage":"esbuild: entry point output not found","messagePattern":"esbuild: entry point output not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/resource_transformers/js/build.go","lineNumber":138,"sourceCode":"\t\t\t\t}\n\t\t\t\tartifacts = append(artifacts, newArtifact(pathSpec.GetBasePath(false)+paths.PathEscape(paths.AddLeadingSlash(transformCtx.OutPath+\".map\")), basePath))\n\t\t\t}\n\t\t} else if isStdinEntryOutput(basePath) {\n\t\t\tmainOutput = file.Contents\n\t\t} else {\n\t\t\t// File-loader artifact; publish directly.\n\t\t\tif err = publishFileLoaderArtifact(pathSpec, opts.PublicPath, outDir, basePath, file.Contents, transformCtx); err != nil {\n\t\t\t\treturn result, err\n\t\t\t}\n\t\t\tartifacts = append(artifacts, newArtifact(fileLoaderRelPermalink(basePath), basePath))\n\t\t}\n\t}\n\n\tsort.Slice(artifacts, func(i, j int) bool { return artifacts[i].RelPermalink() < artifacts[j].RelPermalink() })\n\ttransformCtx.Data[\"Artifacts\"] = artifacts\n\n\tif mainOutput == nil {\n\t\treturn result, fmt.Errorf(\"esbuild: entry point output not found\")\n\t}\n\n\tif hasLinkedSourceMap {\n\t\tsymPath := path.Base(transformCtx.OutPath) + \".map\"\n\t\tif opts.IsCSS {\n\t\t\tre := regexp.MustCompile(`/\\*# sourceMappingURL=.*\\n?`)\n\t\t\tmainOutput = re.ReplaceAll(mainOutput, []byte(\"/*# sourceMappingURL=\"+symPath+\" */\\n\"))\n\t\t} else {\n\t\t\tre := regexp.MustCompile(`//# sourceMappingURL=.*\\n?`)\n\t\t\tmainOutput = re.ReplaceAll(mainOutput, []byte(\"//# sourceMappingURL=\"+symPath+\"\\n\"))\n\t\t}\n\t}\n\n\tif _, err = transformCtx.To.Write(mainOutput); err != nil {\n\t\treturn result, err\n\t}\n\n\treturn result, nil","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/resource_transformers/js/build.go#L120-L156","documentation":"Returned by the JS/esbuild transformer when, after iterating esbuild's OutputFiles, none matched isStdinEntryOutput (i.e. no file whose base name starts with 'stdin.'). Hugo runs esbuild in stdin mode for resources fetched via resources.Get, and expects esbuild to emit a stdin.js (or stdin.css) output as the main entry artifact; its absence means esbuild produced no recognizable entry-point output.","triggerScenarios":"Calling js.Build on a resource and esbuild returns output files that are all sourcemaps or file-loader artifacts with no stdin.* entry file. Can happen with a misconfigured entrypoint, an esbuild version that names the stdin output differently, or an empty/zero-length source.","commonSituations":"A regression or version skew in esbuild changing how stdin-mode output is named; passing an options map that overrides output paths; an empty input resource (e.g. resources.Get returned an empty file) producing no JS output.","solutions":["Upgrade the embedded/extended Hugo build to pick up a compatible esbuild version.","Check that the source resource is non-empty and is actually JS/TS that esbuild can compile.","Avoid overriding 'targetPath' or output options in a way that suppresses the stdin.* entry output; if reproducing, file a Hugo issue with the resource and options map."],"exampleFix":"// before\n{{ $js := resources.Get \"js/empty.js\" | js.Build }} // empty source\n\n// after\n{{ $js := resources.Get \"js/main.js\" | js.Build }} // non-empty entry","handlingStrategy":"validation","validationCode":"// Ensure the source resource is non-empty JS before js.Build.\nif r == nil { return errors.New(\"nil resource for js.Build\") }\nrc, err := r.ReadSeekCloser()\nif err != nil { return err }\nstat, _ := rc.(interface{ Size() int64 }); if stat != nil && stat.Size() == 0 {\n    return errors.New(\"empty source for js.Build\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Hugo updated to a version compatible with your esbuild needs.","Don't override output/targetPath options that suppress the stdin.* entry file.","File a Hugo issue with a minimal reproducer if it persists on valid non-empty JS."],"tags":["esbuild","js-build","asset-pipeline","stdin"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}