{"record":{"id":"99a3ae490163d6f2","repo":"sveltejs/kit","slug":"could-not-find-entry-point","errorCode":null,"errorMessage":"Could not find entry point","messagePattern":"Could not find entry point","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-vercel/index.js","lineNumber":495,"sourceCode":"\t\t\t\t\tkey: 'Sec-Fetch-Dest',\n\t\t\t\t\tvalue: 'document'\n\t\t\t\t}\n\t\t\t],\n\t\t\theaders: {\n\t\t\t\t'Set-Cookie': `__vdpl=${process.env.VERCEL_DEPLOYMENT_ID}; Path=${builder.config.paths.base}/; SameSite=Strict; Secure; HttpOnly`\n\t\t\t},\n\t\t\tcontinue: true\n\t\t});\n\n\t\t// this is a dreadful hack that is necessary until the Vercel Build Output API\n\t\t// allows you to set multiple cookies for a single route. essentially, since we\n\t\t// know that the entry file will be requested immediately, we can set the second\n\t\t// cookie in _that_ response rather than the document response\n\t\tconst base = `${dir}/${builder.config.appDir}/immutable/entry`;\n\t\tconst entry = fs.readdirSync(base).find((file) => file.startsWith('start.'));\n\n\t\tif (!entry) {\n\t\t\tthrow new Error('Could not find entry point');\n\t\t}\n\n\t\troutes.splice(-2, 0, {\n\t\t\tsrc: `/${builder.getAppPath()}/immutable/entry/${entry}`,\n\t\t\theaders: {\n\t\t\t\t'Set-Cookie': `__vdpl=; Path=/${builder.getAppPath()}/version.json; SameSite=Strict; Secure; HttpOnly`\n\t\t\t},\n\t\t\tcontinue: true\n\t\t});\n\t}\n\n\troutes.push({\n\t\thandle: 'filesystem'\n\t});\n\n\t// Prevent incorrect caching: if a request to /_app/immutable/* doesn't match\n\t// a static file, return 404 instead of falling through to dynamic routes.\n\t// Otherwise, we could accidentally immutably cache dynamic content served","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-vercel/index.js#L477-L513","documentation":"When generating the static Vercel config, adapter-vercel locates the immutable entry chunk (a file starting with 'start.') inside the built client output to attach a version-detection cookie header. If the build output directory contains no such file, the build cannot proceed correctly and throws.","triggerScenarios":"fs.readdirSync over `${dir}/${appDir}/immutable/entry` finds no file beginning with 'start.' during static_vercel_config.","commonSituations":"Corrupted or partial build output; a build tool/config change (e.g. custom output dir, chunk naming plugins, Vite rollupOptions altering entry file names) renamed the entry chunk; running the adapter against a stale `.svelte-kit` directory.","solutions":["Clean rebuild: delete .svelte-kit/output (or node_modules/.vite) and run `vite build` again","Check for Vite/Rollup config that changes chunk file naming (output.entryFileNames) and revert it","Ensure no plugin strips or renames files under the immutable/entry directory","Verify the client build actually completed (look for .svelte-kit/output/client/_app/immutable/entry/start.*.js on disk)"],"exampleFix":"// before: custom naming in vite.config\nbuild: { rollupOptions: { output: { entryFileNames: 'app-[name].js' } } }\n// after: remove custom entryFileNames so 'start.*' chunk name is preserved\nbuild: {}","handlingStrategy":"fallback","validationCode":"import { existsSync, readdirSync } from 'fs';\nconst base = '.svelte-kit/output/client/_app/immutable/entry';\nconst ok = existsSync(base) && readdirSync(base).some((f) => f.startsWith('start.'));\nif (!ok) throw new Error('client entry chunk missing — rebuild before adapting');","typeGuard":"const hasEntryChunk = (base) =>\n  existsSync(base) && readdirSync(base).some((f) => f.startsWith('start.'));","tryCatchPattern":"try {\n  await adapt();\n} catch (err) {\n  if (err.message === 'Could not find entry point') {\n    console.error('Rebuild the client output; check Vite/Rollup naming plugins.');\n  }\n  throw err;\n}","preventionTips":["Always run a full clean build before adapter step in CI","Avoid rollupOptions.output.entryFileNames overrides","Do not post-process/delete files under output/client/_app","Verify start.*.js exists in the immutable entry dir if builds behave oddly"],"tags":["vercel","build","filesystem","adapter"],"backgroundTag":"missing-build-artifact","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}