You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I have a component which includes function overloading (inside <script module>):
export function test(
type: 'test',
props: {test: number}
): void;
export function test(type: 'test2'): void;
export function test(type: string, props?: Record<string, any>) {
console.log(type, props);
}
Everything seens fine on the IDE but I still get this weird Rollup Error when running Vite or on the Playground:
[vite] Error when evaluating SSR module /src/routes/+layout.server.ts:
|- RollupError: Expected '{', got ';'
at getRollupError (file:///D:/Coding/Projetos/Playably/github/advent-calendar-template/node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
at convertProgram (file:///D:/Coding/Projetos/Playably/github/advent-calendar-template/node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/parseAst.js:1084:26)
at parseAstAsync (file:///D:/Coding/Projetos/Playably/github/advent-calendar-template/node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/parseAst.js:2070:106)
at async ssrTransformScript (file:///D:/Coding/Projetos/Playably/github/advent-calendar-template/node_modules/.pnpm/vite@5.4.11_@types+node@22.9.0/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52381:11)
at async loadAndTransform (file:///D:/Coding/Projetos/Playably/github/advent-calendar-template/node_modules/.pnpm/vite@5.4.11_@types+node@22.9.0/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:51979:72)
at async instantiateModule (file:///D:/Coding/Projetos/Playably/github/advent-calendar-template/node_modules/.pnpm/vite@5.4.11_@types+node@22.9.0/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52874:44)
We need to detect this and either handle it while stripping types or error and require devs to use a TS preprocessor. Since this doesn't require anything besides removing types we should be able to do the former
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When I have a component which includes function overloading (inside
<script module>
):Everything seens fine on the IDE but I still get this weird Rollup Error when running Vite or on the Playground:
Reproduction
https://svelte.dev/playground/721e958b91b744a192d9557d007fd316?version=5.2.9
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: