vercel/next.js · error
No artifact run found in ${requested}. Expected a results.js
Error message
No artifact run found in ${requested}. Expected a results.json file. What it means
Thrown by resolveArtifactRunDir (analyze-profiles.ts:112) when neither the requested path itself contains results.json nor does any of its subdirectories. The resolver first checks <requested>/results.json; if missing, it scans child dirs for ones containing results.json and picks the most recently modified; if none found, it errors. So this means there are no benchmark run artifacts at the given location.
Source
Thrown at bench/render-pipeline/analyze-profiles.ts:112
const requestedResults = resolve(requested, 'results.json')
if (await exists(requestedResults)) {
return requested
}
const entries = await readdir(requested, { withFileTypes: true })
const dirs = entries.filter((entry) => entry.isDirectory())
const runs: Array<{ dir: string; mtimeMs: number }> = []
for (const dirent of dirs) {
const dir = resolve(requested, dirent.name)
const resultsPath = resolve(dir, 'results.json')
if (!(await exists(resultsPath))) continue
const stats = await stat(resultsPath)
runs.push({ dir, mtimeMs: stats.mtimeMs })
}
if (runs.length === 0) {
throw new Error(
`No artifact run found in ${requested}. Expected a results.json file.`
)
}
runs.sort((a, b) => b.mtimeMs - a.mtimeMs)
return runs[0].dir
}
function toPercent(part: number, total: number): string {
if (total <= 0) return '0.00%'
return `${((part / total) * 100).toFixed(2)}%`
}
function toMs(us: number): string {
return `${(us / 1000).toFixed(1)}ms`
}
function sortTop(View on GitHub (pinned to 0ae8c72462)
Solutions
- Run the benchmark first to produce artifacts: `pnpm bench:render-pipeline --scenario=e2e --stream-mode=node`, which writes results.json under bench/render-pipeline/artifacts/<timestamp>/.
- Omit --artifact-dir so the resolver auto-picks the latest run under the default artifacts root.
- If passing --artifact-dir, give an absolute path or a path relative to the repo root (not cwd), and confirm it contains (or is a parent of dirs containing) results.json.
- Check that previous runs weren't deleted; re-run if artifacts dir is empty.
Example fix
// before // pnpm bench:render-pipeline:analyze --artifact-dir=./out // after — run the benchmark to create artifacts, then analyze with no arg (auto-latest) // pnpm bench:render-pipeline --scenario=e2e --stream-mode=node // pnpm bench:render-pipeline:analyze
Defensive patterns
Strategy: validation
Validate before calling
import { existsSync } from 'node:fs'
import { resolve } from 'node:path'
function hasResultsJsonsomewhere(root: string): boolean {
if (existsSync(resolve(root, 'results.json'))) return true
// shallow scan of immediate subdirs
return false
}
// cheaper: just confirm the benchmark has been run once:
// ls bench/render-pipeline/artifacts/*/results.json Type guard
function isArtifactRunPath(p: string): boolean {
return existsSync(resolve(p, 'results.json'))
} Try / catch
try {
const runDir = await resolveArtifactRunDir(artifactDirArg)
} catch (err) {
if (err instanceof Error && err.message.startsWith('No artifact run found')) {
console.error('Run the benchmark first: pnpm bench:render-pipeline --scenario=e2e --stream-mode=node')
process.exit(2)
}
throw err
} Prevention
- Run the benchmark at least once before analyzing; artifacts are produced under bench/render-pipeline/artifacts/<timestamp>/.
- Pass --artifact-dir as an absolute path or relative-to-repo-root (it's resolve()'d against REPO_ROOT).
- Omit --artifact-dir to auto-pick the latest run.
- Don't delete artifacts/ between runs if you want history.
When it happens
Trigger: Running analyze with --artifact-dir pointing at a path that has no results.json directly and no run subdirectories containing results.json; running analyze before ever running the benchmark; passing a relative path that resolves somewhere unexpected (it is resolve()'d against REPO_ROOT, not cwd).
Common situations: First-time use: no benchmark has been run yet, so bench/render-pipeline/artifacts is empty/absent; pointing --artifact-dir at the artifacts root but the runs were written elsewhere; a typo in the path; runs were cleaned up; relative path misinterpretation because the resolver joins against REPO_ROOT.
Related errors
- Unknown option: --${rawKey}
- Dev server did not become ready within ${timeoutMs}ms
- Invalid --top value: ${topRaw}
- Server process exited before becoming ready (is port already
- Server did not become ready within ${timeoutMs}ms
AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06).
Data as JSON: /api/errors/100c8fea6624c8d0.
Report an issue: GitHub.