{"record":{"id":"6d36a2e4f13eb57e","repo":"react-navigation/react-navigation","slug":"a-path-needs-to-be-specified-when-specifying-ex-6d36a2","errorCode":null,"errorMessage":"A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.","messagePattern":"A 'path' needs to be specified when specifying 'exact: true'\\. If you don't want this screen in the URL, specify it as empty string, e\\.g\\. `path: ''`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/getPathFromState.tsx","lineNumber":475,"sourceCode":"const createConfigItem = (\n  config: PathConfig<{}> | string,\n  parentParts?: PatternPart[]\n): ConfigItem => {\n  if (typeof config === 'string') {\n    const ownParts = getPatternParts(config);\n\n    if (parentParts) {\n      return {\n        parts: combinePatternParts(parentParts, ownParts),\n        ownParts,\n      };\n    }\n\n    return { parts: ownParts, ownParts };\n  }\n\n  if (config.exact && config.path === undefined) {\n    throw new Error(\n      \"A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.\"\n    );\n  }\n\n  // If an object is specified as the value (e.g. Foo: { ... }),\n  // It can have `path` property and `screens` prop which has nested configs\n  const ownParts = config.path ? getPatternParts(config.path) : [];\n  const parts =\n    config.exact !== true\n      ? combinePatternParts(parentParts || [], ownParts)\n      : ownParts.length\n        ? ownParts\n        : undefined;\n\n  const screens =\n    'screens' in config && config.screens\n      ? createNormalizedConfigs(config.screens, parts)\n      : undefined;","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/react-navigation/react-navigation/blob/ab1319d6bbf05eae8dc25e33cbf4dc56494e0f0c/packages/core/src/getPathFromState.tsx#L457-L493","documentation":"In the linking config, `exact: true` means this screen's pattern must match the URL exactly with no prefix inheritance, which only makes sense when the screen declares its own `path`. If exact is set but path is undefined, the library throws at config creation time so the mistake is caught before any linking happens.","triggerScenarios":"Declaring a screen config like Profile: { screen: Profile, exact: true } (or { exact: true, screens: {...} }) in the `screens` linking config without a `path` key.","commonSituations":"Copying a config entry that had a path and removing the path but keeping exact; typos like `paths:` instead of `path:`; intending '' (empty path) but leaving the key out.","solutions":["Add an explicit path: Profile: { path: 'u/:id', exact: true }.","If the screen should live at the root URL, set path: '' explicitly alongside exact: true.","Remove exact: true if you actually want the screen to extend the parent's path prefix.","Verify the config object keys (path not paths) and that path isn't undefined at runtime."],"exampleFix":"// before\nconst config = { screens: { Profile: { exact: true } } };\n// after\nconst config = { screens: { Profile: { path: 'u/:id', exact: true } } };\n// or, for root:\nconst config = { screens: { Profile: { path: '', exact: true } } };","handlingStrategy":"validation","validationCode":"function validateLinkingConfig(screens) {\n  for (const [name, cfg] of Object.entries(screens)) {\n    if (cfg && typeof cfg === 'object' && cfg.exact && cfg.path === undefined) {\n      throw new Error(`Screen '${name}' has exact: true but no path (use path: '' for root)`);\n    }\n    if (cfg?.screens) validateLinkingConfig(cfg.screens);\n  }\n}\nvalidateLinkingConfig(linking.config.screens);","typeGuard":"function isValidScreenConfig(c) {\n  return !(c != null && typeof c === 'object' && c.exact === true && c.path === undefined);\n}","tryCatchPattern":"try {\n  const normalized = createNormalizedConfigs(screens);\n} catch (err) {\n  if (err.message.includes(\"exact: true\")) {\n    console.error('Linking config error:', err.message);\n  } else throw err;\n}","preventionTips":["Always pair exact: true with an explicit path ('' for root-level match).","Run a startup assertion over your linking config in dev builds.","Watch for typos like paths vs path when adding exact screens.","Review config diffs for removed path keys on screens that keep exact."],"tags":["navigation","deep-linking","linking-config"],"backgroundTag":"invalid-linking-config","analyzedSha":"ab1319d6bbf05eae8dc25e33cbf4dc56494e0f0c","analyzedAt":"2026-08-31T14:46:19.520Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}