sveltejs/kit · warning
${description}. Did you mean ${corrected}? at ${path.resolve
Error message
${description}. Did you mean ${corrected}? at ${path.resolve(misspelled)} What it means
`check_spelling` in sync/utils.js detects that a user-referenced entry file (e.g. `src/hooks.server.js` vs `.ts`) appears to be a misspelling of a file that actually exists, and warns with the corrected filename and its resolved absolute path. Sync proceeds but the intended file may not be picked up.
Source
Thrown at packages/kit/src/core/sync/utils.js:84
}
str = str.trim();
return str;
}
/**
* @param {string} original
* @param {string} typo The common misspelling to check for
* @param {string} description What was wrong with the filename
*/
export function check_spelling(original, typo, description) {
const misspelled = resolve_entry(typo);
if (!misspelled) return;
const corrected = path.basename(misspelled).replace(path.basename(typo), path.basename(original));
console.warn(
styleText(
['bold', 'yellow'],
`${description}. Did you mean ${corrected}?` + ` at ${path.resolve(misspelled)}`
)
);
}
View on GitHub (pinned to 03f1687fe6)
Solutions
- Rename the file to the corrected basename shown in the warning (`git mv <misspelled> <corrected>`)
- Update the reference (config option or import) to point at the actual file extension
- Remove a stale duplicate file if both variants exist
Example fix
// before: config points to src/hooks.server.ts, but file is src/hooks.server.js // after git mv src/hooks.server.js src/hooks.server.ts // or update the reference to 'src/hooks.server.js'
Defensive patterns
Strategy: validation
Validate before calling
// check referenced hook files exist before build
import { existsSync } from 'node:fs';
for (const f of ['src/hooks.server.ts', 'src/hooks.server.js', 'src/hooks.client.ts']) {
console.log(f, existsSync(f));
} Type guard
const isValidEntry = (p) => typeof p === 'string' && existsSync(resolve(p));
Prevention
- Use `git mv` so JS/TS extension renames stay consistent in imports and configs
- Stick to one language extension per project for hook files
- Run `svelte-kit sync` in CI to surface spelling warnings early
When it happens
Trigger: svelte.config.js or generated references point at e.g. `src/hooks.server.ts` while only `src/hooks.server.js` exists (or vice versa), or similarly mismatched `+layout.server` / client hook filenames.
Common situations: Renaming a file between .js and .ts during a TypeScript migration; template docs referencing the other extension; files added to the wrong directory.
Related errors
- Files prefixed with + are reserved (saw ${project_relative})
- Files and directories prefixed with + are reserved (saw ${pr
- Only Svelte files can reference named layouts. Remove '${mat
- ${path.relative(process.cwd(), user_config.file)} should ext
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/629d2bc5a4702640.
Report an issue: GitHub.