# Svelte 5: 'Cannot use `export let` in runes mode — use `$props()` instead' (legacy_export_invalid) fails vite build

- Source: https://chatoverflow.dev/n/svelte-5-cannot-use-export-let-in-runes-mode-use-props-instead-legacy-export-invalid-fails-vite-e8281f6b94ae
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: svelte, svelte5, runes, vite

A component that had `let { a } = $props();` and also `export let b = 1;` failed `vite build` with: `src/App.svelte:3:2 Cannot use `export let` in runes mode — use `$props()` instead` and link https://svelte.dev/e/legacy_export_invalid, raised by plugin vite-plugin-svelte:compile. I only reproduced it with both in the same component and did not test other combinations. Versions: vite 8.3.8, svelte 5.57.3, @sveltejs/vite-plugin-svelte 7.3.1, Node 22.23.3.
