hcengineering/platform · error

Project not found: (for task: )

Error message

Project not found: ${issue.clickupProjectName} (for task: ${clickupId})

What it means

In `processClickupTasks`, an issue with a blank parent id but a non-blank `clickupProjectName` must map to a project already registered in `importProjectsByName`. If no project with that exact name exists, the import throws with the project name and task id. The task cannot be attached to any project document.

Solutions

  1. Verify the exact project name on the ClickUp task matches an imported Huly project (watch case/whitespace)
  2. Import or create the missing project first, then re-run the task import
  3. Correct the clickupProjectName field on the task or in the import mapping
  4. Ensure project-defining inputs are included in the same import run as the tasks

Example fix

// before
clickupProjectName: '  Design ' // trailing space; Huly project is 'Design'
// after
clickupProjectName: 'Design' // exact match with imported project name
Defensive patterns

Strategy: validation

Validate before calling

const knownProjects = new Set(Array.from(importProjectsByName.keys()))
for (const [id, issue] of importIssuesByClickupId) {
  if (!issue.clickupParentId && issue.clickupProjectName && !knownProjects.has(issue.clickupProjectName)) {
    console.warn(`task ${id}: project '${issue.clickupProjectName}' not in import set`)
  }
}

Try / catch

try {
  await importer.processClickupTasks(tasks)
} catch (err) {
  const m = /Project not found: (.+?) \(for task/.exec((err as Error).message)
  if (m) console.error(`create/import project '${m[1]}' first`)
  throw err
}

Prevention

When it happens

Trigger: An import issue carries a project name that does not match any project in `importProjectsByName`: name mismatch (typo/case/whitespace), the target project was not imported, or the name changed in ClickUp.

Common situations: Project renamed in ClickUp after a previous mapping; importing tasks into a project name that is only created by another importer step not yet run; case-sensitivity or trailing-space differences between ClickUp and Huly project names; partial import where project definitions were skipped.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/e965ac159b1af92d. Report an issue: GitHub.

Appendix: source

Thrown at packages/importer/src/clickup/clickup.ts:169

        identifier,
        private: false,
        autoJoin: false,
        projectType: importProjectType,
        docs: []
      })
    }

    for (const [clickupId, issue] of importIssuesByClickupId) {
      if (!this.clickupBlankString(issue.clickupParentId)) {
        const parent = importIssuesByClickupId.get(issue.clickupParentId as string)
        if (parent === undefined) {
          throw new Error(`Parent not found: ${issue.clickupParentId} (for task: ${clickupId})`)
        }
        parent.subdocs.push(issue)
      } else if (!this.clickupBlankString(issue.clickupProjectName)) {
        const project = importProjectsByName.get(issue.clickupProjectName as string)
        if (project === undefined) {
          throw new Error(`Project not found: ${issue.clickupProjectName} (for task: ${clickupId})`)
        }
        project.docs.push(issue)
      } else {
        throw new Error(`Task cannot be imported: ${clickupId} (No parent)`)
      }
    }

    return {
      projects: Array.from(importProjectsByName.values()),
      projectType: importProjectType
    }
  }

  private clickupBlankString (str: string | undefined): boolean {
    if (str === undefined || str === null) return true
    return str.trim().length === 0 || str === 'null'
  }

View on GitHub (pinned to 63e28dc964)