{"record":{"id":"ac1ba96db32f8ea0","repo":"sveltejs/kit","slug":"no-netlify-toml-found-using-default-publish-direc","errorCode":null,"errorMessage":"No netlify.toml found. Using default publish directory. Consult https://svelte.dev/docs/kit/adapter-netlify#usage for more details","messagePattern":"No netlify\\.toml found\\. Using default publish directory\\. Consult https://svelte\\.dev/docs/kit/adapter-netlify#usage for more details","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/adapter-netlify/utils.js","lineNumber":67,"sourceCode":" * @param {import('@sveltejs/kit').Builder} builder\n * @returns {string | undefined}\n */\nexport function get_publish_directory(netlify_config, builder) {\n\tif (netlify_config) {\n\t\tif (!netlify_config.build?.publish) {\n\t\t\tbuilder.log.minor('No publish directory specified in netlify.toml, using default');\n\t\t\treturn;\n\t\t}\n\n\t\tif (resolve(netlify_config.build.publish) === process.cwd()) {\n\t\t\tthrow new Error(\n\t\t\t\t'The publish directory cannot be set to the site root. Please change it to another value such as \"build\" in netlify.toml.'\n\t\t\t);\n\t\t}\n\t\treturn netlify_config.build.publish;\n\t}\n\n\tbuilder.log.warn(\n\t\t'No netlify.toml found. Using default publish directory. Consult https://svelte.dev/docs/kit/adapter-netlify#usage for more details'\n\t);\n}\n\n/**\n * @param {*} value\n * @returns {string}\n */\nexport function s(value) {\n\treturn JSON.stringify(value, null, '\\t');\n}\n","sourceCodeStart":49,"sourceCodeEnd":79,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-netlify/utils.js#L49-L79","documentation":"adapter-netlify reads the publish directory from a netlify.toml file in the project root. When none is found, get_publish_directory logs this warning and falls back to Netlify's default publish directory, which may not match where the adapter writes output. The warning points to the adapter-netlify docs so the user adds proper configuration.","triggerScenarios":"Calling adapt() with adapter-netlify when no netlify.toml exists in the project root (so `netlify_config.build.publish` is undefined) and NETLIFY environment config is unavailable.","commonSituations":"Fresh SvelteKit projects scaffolded without netlify.toml; deploying to Netlify where the file was gitignored; CI builds run outside the Netlify environment where the config is normally auto-detected.","solutions":["Create a netlify.toml in the project root with a [build] section specifying the publish directory.","Follow the adapter-netlify docs (https://svelte.dev/docs/kit/adapter-netlify#usage) for the recommended config.","If the file exists, ensure it is committed and present in the build working directory."],"exampleFix":"// netlify.toml\n# before (missing)\n# after\n[build]\n  command = \"npm run build\"\n  publish = \".svelte-kit/cloudflare\"\n# for adapter-netlify typically:\n#   publish = \".svelte-kit/netlify\"","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync('netlify.toml')) {\n  console.warn('netlify.toml missing: adapter-netlify will use the default publish directory');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit a netlify.toml with [build] publish set when scaffolding","Do not gitignore netlify.toml","Verify the file exists in CI before running the build"],"tags":["netlify","adapter","missing-config","build-warning"],"backgroundTag":"missing-config-file","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}