{"record":{"id":"9f0361f8d24e893b","repo":"oxc-project/oxc","slug":"tried-to-get-an-allocator-from-an-empty-fixedsize","errorCode":null,"errorMessage":"Tried to get an allocator from an empty `FixedSizeAllocatorPool`","messagePattern":"Tried to get an allocator from an empty `FixedSizeAllocatorPool`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/oxc_allocator/src/pool/fixed_size.rs","lineNumber":205,"sourceCode":"    ///\n    /// # Panics\n    ///\n    /// * Panics if the pool is empty.\n    /// * Panics if the underlying mutex is poisoned.\n    #[cfg(not(target_os = \"windows\"))]\n    pub fn get(&self) -> Allocator {\n        // Try to get an allocator from the pool.\n        // This is in a block, so that `Mutex` lock is held for the shortest possible time.\n        let maybe_allocator = {\n            let mut allocators_guard = self.allocators.lock().unwrap();\n            allocators_guard.pop()\n        };\n\n        // Panic if pool is empty. Should never happen if the pool was created with the correct `thread_count`.\n        if let Some(allocator) = maybe_allocator {\n            allocator.into_inner()\n        } else {\n            panic!(\"Tried to get an allocator from an empty `FixedSizeAllocatorPool`\")\n        }\n    }\n\n    /// Retrieve an [`Allocator`] from the pool, blocking until one becomes available if the pool is currentlyempty.\n    ///\n    /// Windows implementation.\n    ///\n    /// # Panics\n    /// Panics if the underlying mutex is poisoned.\n    #[cfg(target_os = \"windows\")]\n    pub fn get(&self) -> Allocator {\n        // Try to get an allocator from the pool.\n        // If pool is empty, wait for notification that the pool isn't empty any more.\n        // After receiving a notification, we must still check that pool is not empty,\n        // (no `.pop().unwrap_unchecked()` here), because `Condvar` can produce spurious wakeups.\n        let mut allocators_guard = self.allocators.lock().unwrap();\n        loop {\n            if let Some(allocator) = allocators_guard.pop() {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_allocator/src/pool/fixed_size.rs#L187-L223","documentation":"Diagnostic from oxlint's vue/require-direct-export rule (crates/oxc_linter/src/rules/vue/require_direct_export.rs). The component options object literal in a component script should be exported directly (`export default {...}` / `export default defineComponent({...})`) rather than assigned to an intermediate variable first. The extra variable adds indirection with no benefit and can confuse tooling that expects the default export to be the literal. The `disallowFunctionalComponentFunction` option (default false) also reports functional components defined as plain functions.","triggerScenarios":"`const component = { ... }; export default component;` in a component script, or — when `disallowFunctionalComponentFunction: true` — a functional component function that is not directly exported. The help text says to export the component object directly instead of assigning it to a variable first.","commonSituations":"Habitual named-variable style carried over from plain ES modules; codemods extracting components into variables; wanting JSDoc attached to the variable; teams toggling defineComponent wrappers.","solutions":["Inline the literal: `export default { ... }`.","Attach any JSDoc or type annotations directly above the export statement instead of an intermediate variable.","If the indirection is deliberate (e.g. recursive self-reference by name), suppress with a scoped oxlint-disable comment.","Enable `disallowFunctionalComponentFunction` only if function-style components should be reported too."],"exampleFix":"// before\nconst component = { props: [], template: '<div/>' };\nexport default component;\n\n// after\nexport default { props: [], template: '<div/>' };","handlingStrategy":"validation","validationCode":"// warn when an SFC script exports a variable instead of the literal\nconst m = scriptBlock.match(/export\\s+default\\s+[A-Za-z_$][\\w$]*\\s*;?\\s*$/);\nif (m) console.warn('export the component object literal directly');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write `export default { ... }` as the single component declaration in SFC scripts.","Attach JSDoc above the export statement, not to intermediate variables.","Run the oxlint vue plugin in the editor so the pattern is flagged as you type."],"tags":["vue","oxlint","lint","sfc","export","style","definecomponent"],"backgroundTag":"vue-component-export-style","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"}