{"record":{"id":"0b665d646547998a","repo":"toeverything/AFFiNE","slug":"com-affine-import-onenote-desktop-only","errorCode":null,"errorMessage":"com.affine.import.onenote.desktop-only","messagePattern":"com\\.affine\\.import\\.onenote\\.desktop-only","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/desktop/dialogs/import/index.tsx","lineNumber":714,"sourceCode":"            if (payload) {\n              resolve(payload.workspace);\n            } else {\n              reject(new Error('No workspace imported'));\n            }\n          }\n        );\n      });\n    };\n  }, [globalDialogService]);\n\n  const handleImport = useAsyncCallback(\n    async (type: ImportType) => {\n      setImportError(null);\n      setImportProgress(null);\n      try {\n        const importConfig = importConfigs[type];\n        if (importConfig.nativeOnly && !BUILD_CONFIG.isElectron) {\n          throw new Error(t['com.affine.import.onenote.desktop-only']());\n        }\n        const { acceptType, multiple } = importConfig.fileOptions;\n\n        const files =\n          acceptType === 'Skip'\n            ? []\n            : acceptType === 'Directory'\n              ? await openDirectory({\n                  fileSystemAccess: false,\n                })\n              : await openFilesWith(acceptType, multiple, {\n                  fileSystemAccess: false,\n                  snapshot: shouldSnapshotPickedFiles(type, acceptType),\n                });\n\n        if (!files || (files.length === 0 && acceptType !== 'Skip')) {\n          throw new Error(\n            t['com.affine.import.status.failed.message.no-file-selected']()","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/index.tsx#L696-L732","documentation":"The OneNote import path is implemented only against the Electron desktop APIs; in a non-Electron build (web/mobile) handleImport deliberately aborts with this localized message before any file picker is opened, because importConfig.nativeOnly is true and BUILD_CONFIG.isElectron is false.","triggerScenarios":"Thrown in handleImport when the chosen import config is marked nativeOnly (OneNote) but BUILD_CONFIG.isElectron is false, i.e. the web build lacks the native importer.","commonSituations":"The user clicks OneNote import in the browser version. This import only works in the AFFiNE desktop app; install it to proceed.","solutions":["Perform OneNote import in the desktop app.","Convert the notebook to a supported format for web import."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}