Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Maximum call stack size exceeded" #3218

Closed
Badokas opened this issue Jul 11, 2019 · 7 comments · Fixed by #4316
Closed

"Maximum call stack size exceeded" #3218

Badokas opened this issue Jul 11, 2019 · 7 comments · Fixed by #4316
Labels

Comments

@Badokas
Copy link

Badokas commented Jul 11, 2019

Recursion bug on svelte > 3.6.6 when creating a component using client-side component API. To reproduce: https://svelte.dev/repl/6fbeea34d77f43b9a6d57e1da71668fc?version=3.6.7
This works on 3.5.4.

Error bundle.js:18532 Uncaught (in promise) RangeError: Maximum call stack size exceeded
@mrkishi
Copy link
Member

mrkishi commented Jul 12, 2019

This seems to have been introduced in #3150 — when flush is called while it is already running, render_callbacks are run multiple times.

We might be able to get away with something like if (is_flushing) return, but I'm not sure if there are cases where render_callbacks is modified with the expectation that the dirty_components' update logic runs first.

The safer thing in that case would be to freeze render_callbacks per loop I guess?

@vedam
Copy link
Member

vedam commented Jul 12, 2019

I think I ran into this one too.
Trying to replace dom-elements (coming from .md in my real app) with svelte-components.
I'm pretty sure it worked with 3.5.1 (tried up to) 3.6.3 before updating to 3.6.7.

https://svelte.dev/repl/f3cb47560fcd4decbcabfd42e376607b?version=3.6.3
https://svelte.dev/repl/f3cb47560fcd4decbcabfd42e376607b?version=3.6.7

@prashantsail
Copy link

prashantsail commented Jul 12, 2019

Was about to file a new issue, when I stumbled upon this one.
My app worked fine until version 3.6.3, I am running into this issue since 3.6.4

My Observation

This issue occurs when you create a child component using client side api new Component(options) inside parent's life cycle functions(like onMount, afterUpdate, etc)

Simple repro scenario

😃 https://svelte.dev/repl/d90c6f4e19594c28a4e454b5016570e2?version=3.6.3
🤕 https://svelte.dev/repl/d90c6f4e19594c28a4e454b5016570e2?version=3.6.4

@rob-balfre
Copy link
Contributor

rob-balfre commented Jul 18, 2019

Hideous hack but works until a fix is released...

import { onMount, tick } from 'svelte';

onMount(async() => { 
    await tick();
    new RedChild({ target: document.body })
})

https://svelte.dev/repl/3692752c2bfc4c3f9292bdf84023f852?version=3.6.7

@arggh
Copy link
Contributor

arggh commented Oct 27, 2019

I bumped into this as well while trying to fiddle together Svelte and Google Maps API.

Reproduction here: https://svelte.dev/repl/80e53830f44c46b895376d1de1c08c93?version=3.12.1

@nathancahill
Copy link

nathancahill commented Jan 7, 2020

Also running in to this issue in > 3.6.3. My issue stems from large documents generated from Markdown with numerous classes (like for highlighting code). Reverting to 3.6.3 does not throw the Maximum call stack size exceeded error. This error is thrown in the compile function.

@asvsfs
Copy link

asvsfs commented Apr 20, 2020

Same her

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants