{"record":{"id":"f83276b3ccd5b4b0","repo":"sveltejs/kit","slug":"could-not-find-node-for-url","errorCode":null,"errorMessage":"Could not find node for ${url}","messagePattern":"Could not find node for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/exports/vite/dev/generate_manifest.js","lineNumber":262,"sourceCode":"\t\t});\n\n\t\tthrow err;\n\t}\n}\n\n/**\n * @param {typeof import('vite')} vite\n * @param {ViteDevServer} vite_dev_server\n * @param {ModuleRunner} runner\n * @param {string} id\n */\nasync function resolve(vite, vite_dev_server, runner, id) {\n\tconst url = id.startsWith('..') ? to_fs(path.resolve(id)) : `/${id}`;\n\n\tconst module = await loud_ssr_load_module(vite, vite_dev_server, runner, url);\n\n\tconst module_node = await vite_dev_server.environments.ssr.moduleGraph.getModuleByUrl(url);\n\tif (!module_node) throw new Error(`Could not find node for ${url}`);\n\n\treturn { module, module_node, url };\n}\n\n/**\n * @param {ViteDevServer} vite\n * @param {EnvironmentModuleNode} node\n * @param {Set<EnvironmentModuleNode>} deps\n */\nasync function find_deps(vite, node, deps) {\n\t// since `transformResult.deps` contains URLs instead of `ModuleNode`s, this process is asynchronous.\n\t// instead of using `await`, we resolve all branches in parallel.\n\t/** @type {Promise<void>[]} */\n\tconst branches = [];\n\n\t/** @param {EnvironmentModuleNode} node */\n\tasync function add(node) {\n\t\tif (!deps.has(node)) {","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/exports/vite/dev/generate_manifest.js#L244-L280","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const res = await page.goto(url);\n} catch (err) {\n  if (/Could not find node for/.test(err.message)) {\n    // restart dev server / clear node_modules/.vite, then retry\n  }\n}","preventionTips":["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"],"tags":["vite","dev","module-graph","hmr"],"backgroundTag":"vite-module-not-found","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}