{"record":{"id":"07379d42f87fd046","repo":"swc-project/swc","slug":"no-js-or-jsx-files-found-in","errorCode":null,"errorMessage":"No `.js` or `.jsx` files found in `{}`","messagePattern":"No `\\.js` or `\\.jsx` files found in `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/dbg-swc/src/es/flow/strip.rs","lineNumber":53,"sourceCode":"\n    #[clap(long)]\n    pub enums: bool,\n\n    #[clap(long)]\n    pub decorators: bool,\n\n    #[clap(long)]\n    pub components: bool,\n\n    #[clap(long)]\n    pub pattern_matching: bool,\n}\n\nimpl StripCommand {\n    pub fn run(self, cm: Arc<SourceMap>) -> Result<()> {\n        let files = collect_flow_files(&self.path)?;\n        if files.is_empty() {\n            bail!(\n                \"No `.js` or `.jsx` files found in `{}`\",\n                self.path.display()\n            );\n        }\n\n        let flow_syntax = self.flow_syntax();\n        let mut failures = Vec::new();\n\n        for path in files.iter() {\n            if let Err(err) = verify_file(cm.clone(), path, flow_syntax) {\n                failures.push(err);\n            }\n        }\n\n        let total = files.len();\n        let failed = failures.len();\n        let passed = total - failed;\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/dbg-swc/src/es/flow/strip.rs#L35-L71","documentation":"The Flow strip verification subcommand collects candidate files under the given path via collect_flow_files (a directory walk that keeps .js/.jsx files) and refuses to run when the result set is empty. This is an input sanity check, not a crash: the command has nothing to verify. Only .js and .jsx extensions are considered, regardless of file contents.","triggerScenarios":"Invoking the strip command with --path pointing at a tree that contains no .js/.jsx files: a .ts/.tsx-only project, an empty directory, or the wrong directory level (repo root when sources are in a subdirectory).","commonSituations":"Running against modern TypeScript repositories; forgetting 'git submodule update --init --recursive' so Flow fixture submodules are empty; passing a build output dir instead of the source dir.","solutions":["Point the command at the directory that actually holds the Flow .js/.jsx sources","Verify the file set first: find <path> -name '*.js' -o -name '*.jsx'","Initialize submodules if the Flow corpus lives in one: git submodule update --init --recursive"],"exampleFix":"# before\n$ dbg-swc es flow strip --path .   # repo root, only .ts files\nerror: No `.js` or `.jsx` files found in `.`\n\n# after - target the Flow source tree\n$ git submodule update --init --recursive\n$ dbg-swc es flow strip --path ./submodules/flow/fixtures","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# verify the corpus has candidates before running the strip command\nif ! find \"$TARGET\" -type f \\( -name '*.js' -o -name '*.jsx' \\) | grep -q .; then\n  echo \"no .js/.jsx files under $TARGET\" >&2\n  exit 2\nfi\nexec dbg-swc es flow strip --path \"$TARGET\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Script a find/glob count of .js/.jsx files before invoking the CLI","Run 'git submodule update --init --recursive' when the Flow corpus lives in submodules","Note the walker only matches extensions .js and .jsx - rename or convert other sources first"],"tags":["dbg-swc","flow","cli","empty-input"],"backgroundTag":"no-input-files-found","analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}