` region.","about":"oxc-project/oxc — `VirtualFree` failed: {err}","url":"https://errors.standardbeagle.com/oxc-project/oxc/virtualfree-failed-err/","mainEntityOfPage":"https://errors.standardbeagle.com/oxc-project/oxc/virtualfree-failed-err/","datePublished":"2026-08-20T07:01:07.079Z","dateModified":"2026-08-20T07:01:07.079Z","author":{"@type":"Organization","name":"Standard Beagle","url":"https://standardbeagle.com"},"publisher":{"@type":"Organization","name":"ErrLookup","url":"https://errors.standardbeagle.com","logo":{"@type":"ImageObject","url":"https://errors.standardbeagle.com/og/default.png"}},"proficiencyLevel":"Expert","keywords":"vue, oxlint, lint, sfc, default-export, script, vue-missing-default-export"},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What causes \"`VirtualFree` failed: {err}\" in oxc-project/oxc?","acceptedAnswer":{"@type":"Answer","text":"Add `export default { ... }` (or `export default defineComponent({...})`) with the component options."}}]}]}

oxc-project/oxc · warning

`VirtualFree` failed: {err}

Error message

`VirtualFree` failed: {err}

What it means

Diagnostic from oxlint's vue/require-default-export rule (crates/oxc_linter/src/rules/vue/require_default_export.rs). It fires when a `.vue` Single-File Component has a plain `<script>` block (and no `<script setup>` block anywhere in the file) but no default export. Vue 3 SFCs must default-export the component; a script that only declares variables or named exports leaves the component empty. The label sits on the closing `</script>` region.

Source

Thrown at crates/oxc_allocator/src/arena/fixed_size/windows.rs:452

pub unsafe fn dealloc_fixed_size_arena_chunk(footer_ptr: NonNull<ChunkFooter>) {
    // Create `&ChunkFooter` reference in a block, to ensure it is not live when we deallocate the chunk's memory
    // (which contains the `ChunkFooter`)
    let (backing_alloc_ptr, layout, is_fixed_size) = {
        // SAFETY: Caller guarantees that `footer_ptr` points to a valid `ChunkFooter`
        let footer = unsafe { footer_ptr.as_ref() };
        (footer.backing_alloc_ptr, footer.layout, footer.is_fixed_size)
    };

    debug_assert!(
        is_fixed_size,
        "Only fixed-size allocators should be passed to `dealloc_fixed_size_arena_chunk` to deallocate"
    );

    // SAFETY: Each `ChunkFooter`'s `backing_alloc_ptr` and `layout` describe its backing allocation.
    // Caller guarantees chunk was created with `Arena::new_fixed_size`, so backing allocation was made
    // via `Mmap::reserve` with `layout.size()` bytes.
    unsafe { Mmap::free(backing_alloc_ptr, layout.size()) }.unwrap_or_else(|err| {
        panic!("`VirtualFree` failed: {err}");
    });
}

/// Windows-specific allocator wrapper around `VirtualAlloc` and `VirtualFree`.
///
/// Stateless namespace - all operations are associated functions, not methods.
/// The OS owns the bookkeeping, we just pass the reservation pointer back in for each operation.
///
/// # Usage flow
///
/// ```ignore
/// const RESERVED_SIZE: usize = 1 << 32; // 4 GiB
/// let start_ptr = Mmap::reserve(RESERVED_SIZE).unwrap();
///
/// // Offset pointers to anywhere within reservation using `add` and `sub`
/// // (not `wrapping_add` / `wrapping_sub`), even though this memory is not committed yet
/// let end_ptr = unsafe { start_ptr.add(RESERVED_SIZE) };
/// let mid_ptr = unsafe { end_ptr.sub(RESERVED_SIZE / 2) };

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Add `export default { ... }` (or `export default defineComponent({...})`) with the component options.
  2. If the logic lives in `<script setup>`, delete the plain `<script>` block or move its constants into `<script setup>` or a separate .js/.ts module.
  3. If the file is not a component (pure constants/helpers), move it out of the .vue file to a .js/.ts module so the rule no longer applies.

Example fix

// before
<script>
const foo = 'foo';
</script>

// after
<script>
const foo = 'foo';
export default {
  data() { return { foo }; }
};
</script>
Defensive patterns

Strategy: validation

Validate before calling

// check an SFC has a default export before committing
function hasDefaultExport(sfc) {
  if (/<script[^>]*\bsetup\b/.test(sfc)) return true; // <script setup> supplies the component
  const i = sfc.indexOf('<script');
  if (i === -1) return true; // template-only SFC
  const body = sfc.slice(i, sfc.indexOf('</script>'));
  return body.includes('export default');
}
const fs = require('fs');
if (!hasDefaultExport(fs.readFileSync(file, 'utf8'))) {
  throw new Error(`${file}: SFC lacks a default export`);
}

Prevention

When it happens

Trigger: A .vue file whose only `<script>` contains just constants (`const foo = 'foo'`), named exports (`export const foo`), or named re-exports (`export { foo }`) with no `export default`. The rule skips non-.vue files, files with any `<script setup>` block, and files whose module record has a default export. When the script contains no `defineComponent`/`Vue.component` call, this generic 'Missing default export.' variant is used.

Common situations: Deleting the export during refactor; utility-style SFCs that only export constants; converting a component to `<script setup>` while leaving a stray plain `<script>`; scaffolding tools generating files without the export.

Related errors


AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20). Data as JSON: /api/errors/c37a286283306712. Report an issue: GitHub.