sveltejs/kit · error · Error
Could not find node for ${url}
Error message
Could not find node for ${url} What it means
During dev manifest generation, SvelteKit loads a module via Vite's SSR loader and then looks it up in the dev server's SSR module graph. If the graph returns no node for the constructed URL (module never registered/transformed), resolution fails with this error. It indicates a mismatch between the id used to load the module and what Vite tracked.
Source
Thrown at packages/kit/src/exports/vite/dev/generate_manifest.js:262
});
throw err;
}
}
/**
* @param {typeof import('vite')} vite
* @param {ViteDevServer} vite_dev_server
* @param {ModuleRunner} runner
* @param {string} id
*/
async function resolve(vite, vite_dev_server, runner, id) {
const url = id.startsWith('..') ? to_fs(path.resolve(id)) : `/${id}`;
const module = await loud_ssr_load_module(vite, vite_dev_server, runner, url);
const module_node = await vite_dev_server.environments.ssr.moduleGraph.getModuleByUrl(url);
if (!module_node) throw new Error(`Could not find node for ${url}`);
return { module, module_node, url };
}
/**
* @param {ViteDevServer} vite
* @param {EnvironmentModuleNode} node
* @param {Set<EnvironmentModuleNode>} deps
*/
async function find_deps(vite, node, deps) {
// since `transformResult.deps` contains URLs instead of `ModuleNode`s, this process is asynchronous.
// instead of using `await`, we resolve all branches in parallel.
/** @type {Promise<void>[]} */
const branches = [];
/** @param {EnvironmentModuleNode} node */
async function add(node) {
if (!deps.has(node)) {View on GitHub (pinned to 03f1687fe6)
Solutions
- Restart the Vite dev server (clears the module graph mismatch)
- Delete `node_modules/.vite` cache and restart
- Check for symlink/casing differences in the imported path
- Verify the module itself has no transform error that prevented it from entering the graph
Defensive patterns
Strategy: retry
Try / catch
try {
const res = await page.goto(url);
} catch (err) {
if (/Could not find node for/.test(err.message)) {
// restart dev server / clear node_modules/.vite, then retry
}
} Prevention
- Restart the dev server and clear node_modules/.vite when this appears
- Avoid case-mismatched or symlinked import paths inside src
- Keep SvelteKit and Vite versions in sync
- Commit-lockfile so teammates don't run mismatched plugin versions
When it happens
Trigger: Dev server module graph not yet populated or invalidated (e.g. server restarted, files changed mid-request); a synthetic id (`/src/...` or filesystem id via `to_fs`) that Vite failed to map; requesting a module that failed to transform silently.
Common situations: HMR edge cases after editing route files while a page is loading; symlinks or case-mismatched paths causing the URL to differ from the module graph key; stale dev server after branching/checking out changes.
Related errors
- ${manifest_data.params} does not export `params` from `defin
- The next HMR update will cause the page to reload
- @sveltejs/enhanced-img requires @sveltejs/vite-plugin-svelte
- Could not locate ${file_path}. Please move it to be located
- Could not locate ${file_path}. See https://vitejs.dev/guide/
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/f83276b3ccd5b4b0.
Report an issue: GitHub.