tldraw/tldraw · error · Error

Extension temp directory not found. Make sure packaging comp

Error message

Extension temp directory not found. Make sure packaging completed successfully.

What it means

Thrown by copyExtensionToReleaseFolder() when apps/vscode/extension/temp/ does not exist. The temp dir is supposed to hold the packaged .vsix produced by the preceding `yarn package` step. If it is missing, packaging failed, did not run, or wrote to a different location.

Source

Thrown at internal/scripts/publish-editor-extensions.ts:64

	const packageJsonPath = path.join(EXTENSION_DIR, 'package.json')
	if (!existsSync(packageJsonPath)) {
		throw new Error("Could not find the extension's package.json file.")
	}
	const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
	packageJson.version = nextVersion
	writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, '\t') + '\n')
	return nextVersion
}

async function copyExtensionToReleaseFolder(version: string) {
	if (!existsSync(DISTRIBUTION_DIR)) {
		mkdirSync(DISTRIBUTION_DIR, { recursive: true })
	}

	const tempDir = path.join(EXTENSION_DIR, 'temp')
	if (!existsSync(tempDir)) {
		throw new Error(
			'Extension temp directory not found. Make sure packaging completed successfully.'
		)
	}

	const files = readdirSync(tempDir)
	const vsixFile = files.find((file: string) => file.endsWith('.vsix'))
	if (!vsixFile) {
		throw new Error('No .vsix file found in temp directory.')
	}

	const sourcePath = path.join(tempDir, vsixFile)
	const targetPath = path.join(DISTRIBUTION_DIR, 'tldraw-vscode.vsix')

	nicelog(`Copying extension from ${sourcePath} to ${targetPath}`)
	copyFileSync(sourcePath, targetPath)

	nicelog('Setting git user identity...')
	await exec('git', ['config', 'user.name', 'huppy-bot[bot]'])

View on GitHub (pinned to b31086b447)

Solutions

  1. Run `yarn package` manually in apps/vscode/extension and check its output for errors
  2. Verify the package script writes the .vsix into ./temp
  3. Ensure the prerequisite `yarn lazy run build --filter=packages/*` completed successfully before packaging
  4. Check that cwd is the repo root so the relative temp path resolves
Defensive patterns

Strategy: validation

Validate before calling

// check that packaging actually produced a vsix before copying
const tempDir = path.join(EXTENSION_DIR, 'temp')
if (!existsSync(tempDir) || readdirSync(tempDir).some((f) => f.endsWith('.vsix')) === false) {
  throw new Error('Packaging did not produce a .vsix in temp — run yarn package and inspect its output')
}

Prevention

When it happens

Trigger: existsSync(path.join(EXTENSION_DIR, 'temp')) returns false, after `yarn package` (production) or `yarn package --pre-release` (staging) was supposed to run.

Common situations: `yarn package` failed but the error was swallowed or this function was reached anyway; the package script changed its output directory; clean working tree where temp is gitignored and never created; the build step (`yarn lazy run build --filter=packages/*`) that package depends on failed earlier.

Related errors


AI-assisted analysis of tldraw/tldraw@b31086b447 (2026-08-12). Data as JSON: /api/errors/479a018790ec3a99. Report an issue: GitHub.