{"record":{"id":"70edf9a931662e96","repo":"payloadcms/payload","slug":"collection-config-not-found-for-importcollectio","errorCode":null,"errorMessage":"Collection config not found for: ${importCollection}","messagePattern":"Collection config not found for: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugin-import-export/src/import/getCreateImportCollectionTask.ts","lineNumber":55,"sourceCode":"      } = input\n\n      // Fetch the import document to get all necessary data\n      const importDoc = await req.payload.findByID({\n        id: importId,\n        collection: importCollection,\n      })\n\n      if (!importDoc) {\n        throw new Error(`Import document not found: ${importId}`)\n      }\n\n      // Get the collection config for the imports collection\n      const collectionConfig = req.payload.config.collections.find(\n        (c) => c.slug === importCollection,\n      )\n\n      if (!collectionConfig) {\n        throw new Error(`Collection config not found for: ${importCollection}`)\n      }\n\n      // Retrieve the file using getFileFromDoc (handles both local and cloud storage)\n      const file = await getFileFromDoc({\n        collectionConfig,\n        doc: {\n          filename: importDoc.filename as string,\n          mimeType: importDoc.mimeType as string | undefined,\n          url: importDoc.url as string | undefined,\n        },\n        req,\n      })\n\n      const fileMimetype = file.mimetype || (importDoc.mimeType as string)\n\n      if (!fileMimetype) {\n        throw new FileRetrievalError(\n          req.t,","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/payloadcms/payload/blob/00c58b35c0ed348ddc22daabf467b139727214fd/packages/plugin-import-export/src/import/getCreateImportCollectionTask.ts#L37-L73","documentation":"The createCollectionImport task looks up importCollection in req.payload.config.collections. If no collection with that slug is registered it throws a plain Error. The imports collection must exist in the running Payload config for the task to resolve its upload config.","triggerScenarios":"importCollection slug is misspelled or refers to a collection that was removed/renamed; the imports collection is defined by a plugin that isn't installed; config built without the imports collection.","commonSituations":"Renaming the imports collection without updating the task input; plugin version change that altered the default imports-collection slug; multi-tenant config missing the collection.","solutions":["Ensure importCollection matches a slug present in payload.config.collections.","Check the plugin-import-export config for the imports collection slug and align task input.","If using a custom imports collection, register it in the Payload config."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const exists = req.payload.config.collections.some((c) => c.slug === importCollection)\nif (!exists) {\n  throw new Error(`imports collection not registered: ${importCollection}`)\n}","typeGuard":"const isRegisteredImportsCollection = (slug: string, req: PayloadRequest): boolean =>\n  req.payload.config.collections.some((c) => c.slug === slug)","tryCatchPattern":null,"preventionTips":["Validate the imports-collection slug against config at task input time.","After renaming the imports collection, update task input sources.","Add a config self-test that the imports collection exists on boot."],"tags":["config","jobs","import","plugin-import-export"],"backgroundTag":null,"analyzedSha":"00c58b35c0ed348ddc22daabf467b139727214fd","analyzedAt":"2026-08-12T20:45:03.758Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}