Skip to content

Failed to statically analyse src/routes/ Unexpected token error for loader with async generic function #13809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
minht11 opened this issue May 20, 2025 · 0 comments

Comments

@minht11
Copy link

minht11 commented May 20, 2025

Describe the bug

After #13684 I get Failed to statically analyse when I have additional function with generics:

// import {} from './config'

const loadDataWithGeneric = async <T>() => {};

export const load = () => {};

Comment is needed as well, to trigger it.

Reproduction

Reproduction

Logs

SyntaxError: Failed to statically analyse src/routes/(app)/+layout.ts. Unexpected token (3:40)
...
acorn/dist/acorn.mjs:596:15) {
  pos: 70,
  loc: Position { line: 3, column: 40 },
  raisedAt: 72
}

System Info

npmPackages:
    @sveltejs/adapter-static: ^3.0.8 => 3.0.8 
    @sveltejs/kit: ^2.21.1 => 2.21.1 
    @sveltejs/vite-plugin-svelte: 5.0.3 => 5.0.3 
    rolldown-vite:  6.3.10 
    svelte: ^5.31.1 => 5.31.1

Severity

blocking an upgrade

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant