{"record":{"id":"b2c4adaf853d0296","repo":"denoland/deno","slug":"no-emittable-files-found-only-typescript-jsx-tsx","errorCode":null,"errorMessage":"No emittable files found. Only TypeScript/JSX/TSX files can be transpiled.","messagePattern":"No emittable files found\\. Only TypeScript/JSX/TSX files can be transpiled\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"cli/tools/transpile.rs","lineNumber":102,"sourceCode":"    if !media_type.is_emittable() {\n      log::warn!(\n        \"{} Skipping {} (not a TypeScript/JSX/TSX file)\",\n        colors::yellow(\"Warning\"),\n        file_path.display()\n      );\n      continue;\n    }\n\n    let specifier =\n      ModuleSpecifier::from_file_path(&file_path).map_err(|_| {\n        anyhow::anyhow!(\"Invalid file path: {}\", file_path.display())\n      })?;\n\n    file_entries.push((file_path, specifier, media_type));\n  }\n\n  if file_entries.is_empty() {\n    anyhow::bail!(\n      \"No emittable files found. Only TypeScript/JSX/TSX files can be transpiled.\"\n    );\n  }\n\n  // Transpile each file (TS -> JS)\n  for (file_path, specifier, media_type) in &file_entries {\n    let source_bytes = sys\n      .fs_read(file_path)\n      .with_context(|| format!(\"Failed to read {}\", file_path.display()))?;\n    let source_code = String::from_utf8(source_bytes.into_owned())\n      .with_context(|| format!(\"{} is not valid UTF-8\", file_path.display()))?;\n\n    let parsed_source = deno_ast::parse_module(deno_ast::ParseParams {\n      specifier: specifier.clone(),\n      text: source_code.into(),\n      media_type: *media_type,\n      capture_tokens: false,\n      scope_analysis: false,","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/transpile.rs#L84-L120","documentation":"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.","triggerScenarios":"`deno transpile app.js`, or a glob whose matches are all plain JavaScript/JSON — every entry is skipped and `file_entries` ends up empty.","commonSituations":"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.","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"],"exampleFix":"# before\ndeno transpile dist/**/*.js\n# after\ndeno transpile src/**/*.ts","handlingStrategy":"validation","validationCode":"# bash: verify the file set contains emittable types before running\nemittable=$(find src -type f \\( -name '*.ts' -o -name '*.tsx' -o -name '*.jsx' \\) | wc -l)\n[ \"$emittable\" -gt 0 ] || { echo \"no .ts/.tsx/.jsx inputs\" >&2; exit 1; }\ndeno transpile $(find src -type f -name '*.ts')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["cli","transpile","file-type","typescript"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}