{"record":{"id":"7e68055d33f3b1f0","repo":"swc-project/swc","slug":"flow-strip-verification-failed","errorCode":null,"errorMessage":"flow strip verification failed","messagePattern":"flow strip verification failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbg-swc/src/es/flow/strip.rs","lineNumber":85,"sourceCode":"\n        let total = files.len();\n        let failed = failures.len();\n        let passed = total - failed;\n\n        println!(\"Checked {total} files: {passed} passed, {failed} failed\");\n\n        if !failures.is_empty() {\n            println!(\"Failures:\");\n            for failure in failures {\n                println!(\n                    \"{} [{}] {}\",\n                    failure.path.display(),\n                    failure.stage,\n                    failure.message\n                );\n            }\n\n            bail!(\"flow strip verification failed\");\n        }\n\n        Ok(())\n    }\n\n    fn flow_syntax(&self) -> FlowSyntax {\n        FlowSyntax {\n            jsx: self.jsx,\n            all: self.all,\n            require_directive: self.require_directive,\n            enums: self.enums,\n            decorators: self.decorators,\n            components: self.components,\n            pattern_matching: self.pattern_matching,\n        }\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/dbg-swc/src/es/flow/strip.rs#L67-L103","documentation":"After the Flow strip pass, every collected file is re-verified (parse and comparison stages); each failure is recorded with path, stage and message into a failures list, which the command prints before bailing with this aggregate error. The bail just means 'one or more files failed'; the printed table above it is the actual diagnosis. Causes are either unsupported Flow syntax for the enabled flags or a genuine bug in the strip transforms.","triggerScenarios":"Running the strip verification where at least one file fails parse or verification: Flow features not covered by the passed flags (enums, decorators, JSX, component syntax, pattern matching) or a transform regression in swc's Flow stripper.","commonSituations":"Running with default flags on codebases that use Flow enums or decorators; newer Flow syntax the stripper has not learned; local modifications to the Flow fixtures that are themselves invalid.","solutions":["Read the printed failure table and take the first listed file","Enable the syntax flags matching your corpus: --jsx, --enums, --decorators, --components, --pattern-matching (or --all) and re-run","Minimize the failing file and re-run to confirm the trigger; if it is valid Flow, report it to the SWC repo with the repro and the failure stage"],"exampleFix":"# before\n$ dbg-swc es flow strip --path ./fixtures   # corpus uses Flow enums\n# after - enable the syntax the stripper must accept\n$ dbg-swc es flow strip --path ./fixtures --enums --decorators","handlingStrategy":"try-catch","validationCode":"# smoke-check the corpus with the flags you intend to use before the full run\nfind \"$TARGET\" -type f \\( -name '*.js' -o -name '*.jsx' \\) -print0 |\n  xargs -0 -n1 dbg-swc es flow strip --all --dry-run 2>&1 | tee /tmp/strip-preflight.log || {\n    echo 'preflight found failing files - see log' >&2; exit 2; }\n# run the real verification only when the preflight is clean","typeGuard":null,"tryCatchPattern":"match cmd.run(cm) {\n    Ok(()) => {}\n    Err(e) if format!(\"{e:#}\").contains(\"flow strip verification failed\") => {\n        // failures were already printed with path/stage/message;\n        // capture them into a report instead of aborting the whole batch\n        write_report(\"/tmp/flow-strip-failures.md\")?;\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Enable the syntax flags matching your corpus (--enums, --decorators, --jsx, --all)","Run the strip command on new Flow fixtures in CI before merging parser changes","Keep a known-good fixture set to bisect stripper regressions quickly"],"tags":["dbg-swc","flow","verification","transform"],"backgroundTag":"transform-verification-failed","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"}