-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
If the generated JavaScript code (for the simplest Hello World case) is given a .ts extension and analyzed by the TypeScript compiler, the error is "Expected 7-8 arguments, but got 6." This is because the current prototype of the init function in Component.ts requires append_styles.
Reproduction
You can see this in my STEMCstudio browser-based application (an online coding environment for education that supports Svelt).
https://stemcstudio.com/gists/078c883495d81d6976ae798c9e243b76
Selecting the "Workspace Settings" menu (cog wheel) and the "Show Intermediate (TypeScript) Code" menu item shows that the call to init has six arguments. The append_styles parameter is not required (as evidence in the Svelt source code).
The fix would be to change the append_styles type in src/runtime/internal/Component.ts to something like:
append_styles?: (root: Element | ShadowRoot) => void,
OR
append_styles?: (root: Node) => void
I'm not quite sure which is best or what the intent is.
I can make a recommendation if rectifying this issue is given favorable consideration.
Logs
No response
System Info
Version 3.46.3 of Svelte and below.Severity
annoyance