denoland/deno · error · anyhow::Error
No emittable files found. Only TypeScript/JSX/TSX files can
Error message
No emittable files found. Only TypeScript/JSX/TSX files can be transpiled.
What it means
Inputs are filtered by `MediaType::is_emittable`; only TypeScript/JSX/TSX sources qualify. Non-emittable files (.js, .mjs, .json, .css, ...) each log a 'Skipping ... (not a TypeScript/JSX/TSX file)' warning and are dropped; if nothing remains the tool bails with this message.
Source
Thrown at cli/tools/transpile.rs:102
if !media_type.is_emittable() {
log::warn!(
"{} Skipping {} (not a TypeScript/JSX/TSX file)",
colors::yellow("Warning"),
file_path.display()
);
continue;
}
let specifier =
ModuleSpecifier::from_file_path(&file_path).map_err(|_| {
anyhow::anyhow!("Invalid file path: {}", file_path.display())
})?;
file_entries.push((file_path, specifier, media_type));
}
if file_entries.is_empty() {
anyhow::bail!(
"No emittable files found. Only TypeScript/JSX/TSX files can be transpiled."
);
}
// Transpile each file (TS -> JS)
for (file_path, specifier, media_type) in &file_entries {
let source_bytes = sys
.fs_read(file_path)
.with_context(|| format!("Failed to read {}", file_path.display()))?;
let source_code = String::from_utf8(source_bytes.into_owned())
.with_context(|| format!("{} is not valid UTF-8", file_path.display()))?;
let parsed_source = deno_ast::parse_module(deno_ast::ParseParams {
specifier: specifier.clone(),
text: source_code.into(),
media_type: *media_type,
capture_tokens: false,
scope_analysis: false,View on GitHub (pinned to 89f33cbef2)
Solutions
- Read the per-file 'Skipping ...' warnings printed above the error — they name exactly which files were dropped
- Pass .ts/.tsx/.jsx inputs: `deno transpile src/**/*.ts`
- If the files are plain JavaScript, transpilation is unnecessary — run or bundle them directly instead
Example fix
# before deno transpile dist/**/*.js # after deno transpile src/**/*.ts
Defensive patterns
Strategy: validation
Validate before calling
# bash: verify the file set contains emittable types before running
emittable=$(find src -type f \( -name '*.ts' -o -name '*.tsx' -o -name '*.jsx' \) | wc -l)
[ "$emittable" -gt 0 ] || { echo "no .ts/.tsx/.jsx inputs" >&2; exit 1; }
deno transpile $(find src -type f -name '*.ts') Prevention
- Scope globs to *.ts/*.tsx/*.jsx explicitly
- Watch the 'Skipping ...' warnings — they list exactly what was filtered
- Use transpile only for TypeScript-family sources; JS inputs need no transpilation
When it happens
Trigger: `deno transpile app.js`, or a glob whose matches are all plain JavaScript/JSON — every entry is skipped and `file_entries` ends up empty.
Common situations: Pointing transpile at a directory of already-compiled JS; wrong glob (`*.js` instead of `*.ts`); using transpile where the sources were assumed to be TypeScript.
Related errors
- Type checking failed: {}
- Type checking failed.
- No input files specified
- Cannot use --output with multiple input files. Use --outdir
- Cannot use --declaration without --output or --outdir. Decla
AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16).
Data as JSON: /api/errors/b2c4adaf853d0296.
Report an issue: GitHub.