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
In my Svelte component, I've implemented several lifecycle functions like onMount, onDestroy, beforeUpdate, afterUpdate, and tick. Only onDestroy and tick are being called inside a console, the other lifecycle functions aren't producing any output.
Steps to Reproduce:
Create a following Svelte component with all the lifecycle functions:
<script>
import {onMount,beforeUpdate,afterUpdate,onDestroy,tick} from 'svelte';
let count = 0;
onMount(() =>{console.log("onMount: Component has mounted");});
beforeUpdate(() =>{console.log(`beforeUpdate: About to update. Current count: ${count}`);});
afterUpdate(() =>{console.log(`afterUpdate: State has updated. Current count: ${count}`);});
onDestroy(() =>{console.log("onDestroy: Component will be destroyed");});
async function increment() {count+=1;awaittick();console.log(`tick: DOM updated after incrementing count to ${count}`);}</script><buttonon:click={increment}>Increment({count})</button>
It seems like the bundle.js file created from rollup config doesn't include any of the other functions
functioninstance$2($$self,$$props,$$invalidate){letcount=0;onDestroy(()=>{console.log("onDestroy: Component will be destroyed");});asyncfunctionincrement(){$$invalidate(0,count+=1);awaittick();console.log(`tick: DOM updated after incrementing count to ${count}`);}return[count,increment];}
Expected Behavior:
The console should show logs from all lifecycle functions: onMount, beforeUpdate, afterUpdate, and tick.
Actual Behavior:
Only the tick and onDestroy are called
Additional Information:
Svelte version: 4.2.0
rollup-plugin-svelte version : 7.1.6
The text was updated successfully, but these errors were encountered:
Description:
In my Svelte component, I've implemented several lifecycle functions like onMount, onDestroy, beforeUpdate, afterUpdate, and tick. Only onDestroy and tick are being called inside a console, the other lifecycle functions aren't producing any output.
Steps to Reproduce:
Create a following Svelte component with all the lifecycle functions:
It seems like the bundle.js file created from rollup config doesn't include any of the other functions
Expected Behavior:
The console should show logs from all lifecycle functions: onMount, beforeUpdate, afterUpdate, and tick.
Actual Behavior:
Only the tick and onDestroy are called
Additional Information:
The text was updated successfully, but these errors were encountered: