Maximum call stack size exceeded: Vite doesn't like MANY elements

See original GitHub issue

Description

I have a page with 200 elements. Vite chokes on it. When I reduce the amount of items on the page, it renders just fine. Here’s what happens when I run my app and navigate to the page:

  SvelteKit v1.0.0-next.109

  local:   http://localhost:2513
  network: not exposed

  Use --host to expose server to other devices on this network


11:28:56 AM [vite] Internal server error: Maximum call stack size exceeded
  Plugin: vite-plugin-svelte
  File: ~/my-app/src/pages/product/catalogue/index.svelte
      at handle_var_declaration (~/my-app/node_modules/svelte/compiler.js:5959:11)
      at VariableDeclaration (~/my-app/node_modules/svelte/compiler.js:6243:11)
      at handle (~/my-app/node_modules/svelte/compiler.js:5711:18)
      at ~/my-app/node_modules/svelte/compiler.js:5901:19
      at Array.map (<anonymous>)
      at handle_body (~/my-app/node_modules/svelte/compiler.js:5900:22)
      at ~/my-app/node_modules/svelte/compiler.js:5977:8
      at ~/my-app/node_modules/svelte/compiler.js:5879:11
      at handle (~/my-app/node_modules/svelte/compiler.js:5711:18)
      at ~/my-app/node_modules/svelte/compiler.js:6236:8

Here is what one of the elements looks like:

  <u-cell class="domain-price" flex span="2">
    <a class="extension" href="/product/catalogue/chown" title={generateTLDLinkTitle("chown")}>.chown</a>
    <span class="price">9.00</span>
    <span class="divider">/</span>
    <span class="price premium">121.00</span>
  </u-cell>

Reproduction

https://gist.github.com/NetOpWibby/8e6fd8c3d1f326284e254f7f80cd4c31

Additional Information

  System:
    OS: macOS 11.3.1
    CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
    Memory: 1.12 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.2.0 - ~/.nvm/versions/node/v16.2.0/bin/node
    npm: 7.13.0 - ~/.nvm/versions/node/v16.2.0/bin/npm
  Browsers:
    Edge: 81.0.416.62
    Firefox: 88.0.1
    Safari: 14.1
  npmPackages:
    svelte: ^3.38.2 => 3.38.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
NetOpWibbycommented, Jul 7, 2022

@alexbjorlig Ah, I shortened my username so the link broke. Fixed now!

0reactions
alexbjorligcommented, Jul 7, 2022

@NetOpWibby the solution you linked gives 404. Do you remember what the solution was?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue.js "Maximum call stack size exceeded" error. Passing ...
The reason you have the error. Maximum call stack size exceeded. is because of this import PanelBody from '../components/PanelBody' export ...
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >
Deal With “Maximum Call Stack Size Exceeded” in JavaScript
Dealing with the “Maximum call stack size exceeded” error is easy. All you have to do is avoid using the spread operator or...
Read more >
Maximum callstack size Vite / Page keeps reloading-Vue.js
Coding example for the question Maximum callstack size Vite / Page keeps reloading-Vue.js. ... The problem was in the vite.json when using Docker....
Read more >
“provider js maximum call stack size exceeded "vite"” Code ...
It is likely that a function with infinite loop is being called.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found