{"record":{"id":"487d4175fc417e86","repo":"oxc-project/oxc","slug":"missing-default-export","errorCode":null,"errorMessage":"Missing default export.","messagePattern":"Missing default export\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vue/require_default_export.rs","lineNumber":13,"sourceCode":"use oxc_ast::{AstKind, ast::Expression};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{\n    context::{ContextHost, LintContext},\n    frameworks::FrameworkOptions,\n    rule::Rule,\n};\n\nfn missing_default_export_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Missing default export.\").with_label(span)\n}\n\nfn must_be_default_export_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Component must be the default export.\").with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct RequireDefaultExport;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Require components to be the default export.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// Using SFCs (Single File Components) without a default export is\n    /// not supported in Vue 3. Components should be exported as the default export.","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/require_default_export.rs#L1-L31","documentation":"Emitted by run_once of the vue require-default-export rule when a .vue file (or script block) contains no default export at all. It is a structural guard: Vue SFC tooling expects the component to be the module's default export, and its absence breaks consumption of the file.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/vue/require_default_export.rs:13 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a default export for the component, e.g. export default defineComponent({ ... }) or a top-level <script setup> block"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}