{"record":{"id":"ea24c3a566a43887","repo":"windmill-labs/windmill","slug":"raw-app-ref-path-has-no-compiled-bundle-deplo","errorCode":null,"errorMessage":"raw app ${ref.path} has no compiled bundle — deploy it first","messagePattern":"raw app (.+?) has no compiled bundle — deploy it first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/workspaceSettings/deployToHubSession.svelte.ts","lineNumber":771,"sourceCode":"\t\t\t\t\t\t)\n\t\t\t\t\t\tif (isModern) {\n\t\t\t\t\t\t\tconst a = await AppService.getAppByPath({ workspace, path: ref.path })\n\t\t\t\t\t\t\tconst secret = await AppService.getPublicSecretOfLatestVersionOfApp({\n\t\t\t\t\t\t\t\tworkspace,\n\t\t\t\t\t\t\t\tpath: ref.path\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t// The compiled JS bundle is required; a missing one means the app\n\t\t\t\t\t\t\t// was never built/deployed, so fail loudly instead of pushing a blank app.\n\t\t\t\t\t\t\tconst [jsRes, cssRes] = await Promise.all([\n\t\t\t\t\t\t\t\tfetch(`/api/w/${workspace}/apps/get_data/v/${secret}.js`, {\n\t\t\t\t\t\t\t\t\tcredentials: 'include'\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tfetch(`/api/w/${workspace}/apps/get_data/v/${secret}.css`, {\n\t\t\t\t\t\t\t\t\tcredentials: 'include'\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\tif (!jsRes.ok) {\n\t\t\t\t\t\t\t\tthrow new Error(`raw app ${ref.path} has no compiled bundle — deploy it first`)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst js = await jsRes.text()\n\t\t\t\t\t\t\tconst css = cssRes.ok ? await cssRes.text() : ''\n\t\t\t\t\t\t\tconst v: any = a.value ?? {}\n\t\t\t\t\t\t\tconst content = JSON.stringify({\n\t\t\t\t\t\t\t\tfiles: { ...(v.files ?? {}), '/bundle.js': js, '/bundle.css': css },\n\t\t\t\t\t\t\t\trunnables: v.runnables ?? {},\n\t\t\t\t\t\t\t\t// Preserve the full-code app's explicit data table declaration so it\n\t\t\t\t\t\t\t\t// survives publish/import and feeds migration detection.\n\t\t\t\t\t\t\t\t...(v.data !== undefined ? { data: v.data } : {}),\n\t\t\t\t\t\t\t\t...(v.datatables !== undefined ? { datatables: v.datatables } : {})\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\treturn { kind: 'raw_app', path: ref.path, summary: a.summary, content }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst r = await fetch(`/api/w/${workspace}/raw_apps/get_data/0/${ref.path}`, {\n\t\t\t\t\t\t\tcredentials: 'include'\n\t\t\t\t\t\t})\n\t\t\t\t\t\tif (!r.ok) return undefined","sourceCodeStart":753,"sourceCodeEnd":789,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/workspaceSettings/deployToHubSession.svelte.ts#L753-L789","documentation":"When exporting a raw app to the Hub, the session fetches the app's compiled JS bundle at /api/w/<workspace>/apps/get_data/v/<secret>.js. A non-OK response means the raw app has never been deployed (no compiled bundle exists), and deploying an app without a bundle to the Hub would ship an empty/broken artifact, so it throws this error.","triggerScenarios":"saveApp/raw-app export path fetches the bundle JS and jsRes.ok is false — the app at ref.path exists but was never deployed (draft-only), was deployed under a different workspace, or the fetch 404s because the compiled asset is missing.","commonSituations":"Editing a raw app locally and exporting to Hub without ever hitting Deploy; the app was undeployed or its deployment deleted; a stale reference pointing at an app path that no longer has a published version.","solutions":["Deploy the raw app first (Deploy button / push the app), then retry the Hub export","Verify ref.path points to the app's deployed path in the correct workspace","Check you have permission to read the app's compiled assets in that workspace"],"exampleFix":"// before\nawait session.exportToHub(ref)  // app never deployed\n// after\nawait deployApp(workspace, ref.path)  // ensures compiled bundle exists\nawait session.exportToHub(ref)","handlingStrategy":"validation","validationCode":"const app = await AppService.getApp({ workspace, path: ref.path })\nif (!app || app.no_version) throw new Error(`Deploy ${ref.path} before exporting to Hub`)","typeGuard":null,"tryCatchPattern":"try {\n  await session.exportToHub(ref)\n} catch (e) {\n  if (String(e.message).includes('has no compiled bundle')) {\n    // trigger app deployment, then retry the export\n  }\n}","preventionTips":["Always deploy raw apps before exporting them to the Hub","Validate app references point at live, deployed paths in the current workspace","Add a pre-export check for a compiled bundle in automation that batch-exports apps"],"tags":["raw-apps","deployment","hub","http"],"backgroundTag":"app-not-deployed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}