{"record":{"id":"ebcc860fdeec4949","repo":"cypress-io/cypress","slug":"failed-to-load-next-dist-build-load-jsconfig-wit","errorCode":null,"errorMessage":"Failed to load \"next/dist/build/load-jsconfig\" with error: ${ e.message ?? e}","messagePattern":"Failed to load \"next/dist/build/load-jsconfig\" with error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/webpack-dev-server/src/helpers/nextHandler.ts","lineNumber":73,"sourceCode":"    packages.loadConfig = require(loadConfigPath).default\n  } catch (e: any) {\n    throw new Error(`Failed to load \"next/dist/server/config\" with error: ${e.message ?? e}`)\n  }\n\n  try {\n    const getNextJsBaseWebpackConfigPath = require.resolve('next/dist/build/webpack-config', resolvePaths)\n\n    packages.getNextJsBaseWebpackConfig = require(getNextJsBaseWebpackConfigPath).default\n  } catch (e: any) {\n    throw new Error(`Failed to load \"next/dist/build/webpack-config\" with error: ${ e.message ?? e}`)\n  }\n\n  try {\n    const loadJsConfigPath = require.resolve('next/dist/build/load-jsconfig', resolvePaths)\n\n    packages.nextLoadJsConfig = require(loadJsConfigPath).default\n  } catch (e: any) {\n    throw new Error(`Failed to load \"next/dist/build/load-jsconfig\" with error: ${ e.message ?? e}`)\n  }\n\n  // Does not exist prior to Next 13.\n  try {\n    const getUtilsPath = require.resolve('next/dist/build/utils', resolvePaths)\n\n    packages.getSupportedBrowsers = require(getUtilsPath).getSupportedBrowsers ?? (() => Promise.resolve([]))\n  } catch (e: any) {\n    throw new Error(`Failed to load \"next/dist/build/utils\" with error: ${ e.message ?? e}`)\n  }\n\n  return packages\n}\n\n/**\n * Types for `getNextJsBaseWebpackConfig` based on version:\n * - v14.0.0, v15.0.0, and v16.0.0\n  [","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/npm/webpack-dev-server/src/helpers/nextHandler.ts#L55-L91","documentation":"Thrown by the Next.js handler when require.resolve('next/dist/build/load-jsconfig', resolvePaths) fails. nextLoadJsConfig is the helper Next uses to apply jsconfig.json path aliases and base url resolution; Cypress imports it so the same module resolution rules apply inside component tests. Unlike next/dist/build/utils (which has a fallback for pre-Next-13), load-jsconfig has no fallback path — any resolve failure becomes this error.","triggerScenarios":"Using a Next.js version older than 13 where load-jsconfig did not exist, or a custom Next.js fork / alias that omits the file. Also triggered by broken installs where the file is missing from dist/build.","commonSituations":"Legacy Next.js 12 project upgraded Cypress without upgrading Next, broken node_modules, or `next` resolved to a non-standard distribution (e.g. a private fork).","solutions":["Upgrade Next.js to a version Cypress supports (>= 13).","Reinstall node_modules to restore the missing file.","If you must stay on Next 12, downgrade @cypress/webpack-dev-server to a version that has a fallback for load-jsconfig.","Verify resolution: `node -e \"console.log(require.resolve('next/dist/build/load-jsconfig'))\"`."],"exampleFix":"// before\n\"next\": \"^12.3.0\"\n// after\n\"next\": \"^14.2.0\"","handlingStrategy":"validation","validationCode":"function assertLoadJsConfig (resolvePaths: string[]) {\n  try {\n    require.resolve('next/dist/build/load-jsconfig', { paths: resolvePaths })\n  } catch {\n    throw new Error('Next.js < 13 detected; upgrade Next to enable Cypress CT load-jsconfig')\n  }\n}","typeGuard":"function supportsNextLoadJsConfig (resolvePaths: string[]): boolean {\n  try { require.resolve('next/dist/build/load-jsconfig', { paths: resolvePaths }); return true }\n  catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Stay on Next.js >= 13 when using current Cypress CT.","If pinned to Next 12, use a Cypress / webpack-dev-server version with a fallback.","Validate resolution in CI before running cypress."],"tags":["nextjs","dependency-resolution","dev-server","version-mismatch"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}