{"record":{"id":"0a7c47443f10b368","repo":"hcengineering/platform","slug":"linked-page-not-found-outside-of-this-import","errorCode":null,"errorMessage":"Linked page not found (outside of this import): ","messagePattern":"Linked page not found \\(outside of this import\\): ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/importer/src/notion/notion.ts","lineNumber":504,"sourceCode":"      }\n    } else {\n      traverseNodeMarks(node, (mark) => {\n        if (mark.type === MarkupMarkType.link) {\n          const href = mark.attrs?.href ?? ''\n          switch (getLinkType(href)) {\n            case NOTION_MD_LINK_TYPES.UNKNOWN:\n            case NOTION_MD_LINK_TYPES.EXTERNAL_LINK: {\n              console.log('skip this type of link: ', href)\n              return\n            }\n            case NOTION_MD_LINK_TYPES.INTERNAL_LINK: {\n              const notionId = getFileId('', href)\n              const targetMeta = documentMetaMap.get(notionId)\n              console.log('Target HULY page ID:', targetMeta?.id)\n              if (targetMeta !== undefined) {\n                alterInternalLinkNode(node, targetMeta)\n              } else {\n                console.warn('Linked page not found (outside of this import): ' + href)\n              }\n              return\n            }\n            case NOTION_MD_LINK_TYPES.ATTACHMENT: {\n              const notionId = getFileId('', href)\n              const attachmentMeta = documentMetaMap.get(notionId)\n              if (attachmentMeta !== undefined) {\n                console.log('Attachment found: ', attachmentMeta)\n                alterAttachmentNode(node, attachmentMeta, href)\n              } else {\n                console.warn('Attachment not found: ', href)\n              }\n            }\n          }\n        }\n      })\n    }\n    return true","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/notion/notion.ts#L486-L522","documentation":"During Notion import, preProcessMarkdown rewrites internal links in exported markdown. When a link target's Notion ID is not present in documentMetaMap (the map of pages included in this import), the page was not imported, so the link cannot be rewritten to a Huly page and the warning 'Linked page not found (outside of this import): <href>' is emitted. The link node is left unchanged.","triggerScenarios":"importPageDocument processes a page whose markdown contains an internal Notion link whose getFileId('', href) key is absent from documentMetaMap - i.e. the target page exists in Notion but is outside the selected import set.","commonSituations":"Selectively importing one page/subtree while it links to pages not included in the import; deleted Notion pages still referenced by links; permission-restricted pages excluded from the export; external links misclassified as internal.","solutions":["Include the linked page in the import selection so targetMeta exists in documentMetaMap.","Accept the broken link and fix it manually in Huly after import.","Pre-process the Notion export to repoint or strip links to pages outside the import.","Verify link classification (internal vs external via isExternalLink/URL.canParse) is not misrouting links."],"exampleFix":"// before\nconsole.warn('Linked page not found (outside of this import): ' + href)\n// after\n// ensure the target page is part of the import set, or collect for post-import fixup\nunresolvedLinks.push(href) // remap in a second pass once all pages are imported","handlingStrategy":"validation","validationCode":"// Before import, verify every internal link target is included in the import set\nconst missing = links.filter(href => !documentMetaMap.has(getFileId('', href)))\nif (missing.length > 0) console.warn('Pages outside import:', missing)\n","typeGuard":"function hasTargetMeta (href: string, metaMap: Map<string, { id: string }>): boolean {\n  return metaMap.has(getFileId('', href))\n}\n","tryCatchPattern":null,"preventionTips":["Import complete page sets so internal links resolve.","Collect unresolved links and fix them in a post-import pass.","Verify link classification (internal vs external) before rewriting."],"tags":["import","notion","links","migration"],"backgroundTag":"imported-link-target-missing","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}