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
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).
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
The text was updated successfully, but these errors were encountered:
stemcstudio
changed the title
append_styles is typed as a required parameter in function init(...)
append_styles s/b typed as an optional parameter in function init(...)
Jan 28, 2022
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
Severity
annoyance
The text was updated successfully, but these errors were encountered: