-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Description
Describe the bug
Scripts that are not the component top-level script do not seem to execute.
Apparently the way that <script> gets inserted into the document matters for execution, maybe that needs a special case.
Reproduction
<div>
<!-- NOT a Svelte script -->
<script>
function logMessage(text) {
console.log(text);
}
console.log('logMessage is', typeof logMessage);
</script>
</div>
<button onclick={() => eval("logMessage('Hello')")}>
Log "Hello"
</button>Thought that maybe isolating the <script> so it would be inserted separately using {#if true} instead of a div would maybe help, but it did not.
Logs
No response
System Info
REPLSeverity
annoyance