Skip to content

Runes Mode: props() missing, $$props disallowed, and EmptyStatement crashes compilerΒ #16227

@gary2505

Description

@gary2505

Describe the bug

I use anysonhover template project from gibhub and rune for tabs. Copilot and chatGPT 4.1 create this code and they works to fix the problems.
I spend couple day to try the code working... but nothing. Chat GPT said this is Svelte rune problems. It is no ready for props() and new features.

While working with Svelte 5 runes: true (version 5.0.0-next.272), I encountered multiple critical issues that made it impossible to develop even a basic component using props and classic Svelte stores.
Svelte: 5.0.0-next.272
vite-plugin-svelte: latest
Vite: 5.x
Tailwind CSS: 4.x
// vite.config.ts
svelte({ compilerOptions: { runes: true }});

❗ Problems

  1. props() is not exported from 'svelte'
    import { props } from 'svelte'; // ❌ TS error: no exported member
    So the recommended $props() fallback is undocumented and unclear.

  2. Using export let throws runtime error (expected under runes: true):
    Cannot use export let in runes mode β€” use $props() instead

  3. Using $$props throws runtime error:
    Cannot use $$props in runes mode

  4. Using $props<{ id: string }>() causes compiler crash:
    [plugin:vite-plugin-svelte] Not implemented type annotation EmptyStatement

    Comes from esrap inside vite-plugin-svelte.

πŸ” I Tried

let { id } = $props<{ id: string }>(); β†’ crash
let { id } = $props() as { id: string }; β†’ still crashes
Tried pnpm add @sveltejs/runes β†’ not published
export let and $$props both forbidden

πŸ”§ Current Workaround

The only stable solution was to disable runes:

Reproduction

by request

Logs

[plugin:vite-plugin-svelte] Not implemented type annotation EmptyStatement

C:/VSCode/bApp/src/lib/components/Tabs/TabHeader.svelte

    at handle_type_annotation (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:624:10)
    at Identifier (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:1107:28)
    at handle (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:61:2)
    at sequence (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:405:4)
    at FunctionDeclaration|FunctionExpression (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:841:3)
    at handle (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:61:2)
    at handle_body (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:312:3)
    at Program (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:1343:3)
    at handle (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/handlers.js:61:2)
    at print (file:///C:/VSCode/bApp/node_modules/.pnpm/[email protected]/node_modules/esrap/src/index.js:44:2

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (4) x64 Intel(R) N100
    Memory: 5.55 GB / 15.75 GB
  Binaries:
    Node: 24.1.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 11.4.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.12.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
FF 139.0.4 (64bt)
    Edge: Chromium (135.0.3179.66)

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions