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, presumably due to my 3100 line long markdown file #358

Closed
boehs opened this issue Oct 20, 2021 · 7 comments
Closed

Maximum call stack, presumably due to my 3100 line long markdown file #358

boehs opened this issue Oct 20, 2021 · 7 comments
Labels
bug Something isn't working 🕵️ I'm looking into it

Comments

@boehs
Copy link

boehs commented Oct 20, 2021

Don't ask why.

image

It's a glorious 138kb file

Tests I did:

  1. Moving the mostrosity of a markdown file to the routes folder
  • this did not work
  1. Converting it to HTML before hand and putting it in my routes
  • this did work.

This makes it likely a MDsveX issue

9:07:39 PM [vite] Internal server error: Maximum call stack size exceeded
  File: C:/Users/<redacted>/Personal/Notes/blog/<You really don't want to know>.md
      at handle_var_declaration (file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6470:10)       
      at VariableDeclaration (file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6755:10)
      at handle (file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6175:17)
      at file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6408:18
      at Array.map (<anonymous>)
      at handle_body (file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6407:21)
      at file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6489:7
      at scoped_fn (file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6376:10)
      at handle (file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6175:17)
      at file:///C:/Users/<redacted>/Personal/Code/Contrib/site/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/compiler.mjs:6748:7
Terminate batch job (Y/N)?
^C
@pngwn pngwn added 🕵️ I'm looking into it bug Something isn't working labels Oct 20, 2021
@pngwn
Copy link
Owner

pngwn commented Oct 20, 2021

I think I know what this is but I don't know how much I can do about it. The files needs to be loaded into memory and the AST needs to exist in memory as well because this mdsvex is primarily a preprocessor. It is probably the size of the AST that is causing an issue.

I'll take a closer look and try to figure out exactly what the problem is, increasing the memory of the node process will probably fix this as a quick workaround.

@rmunn
Copy link

rmunn commented Oct 26, 2021

Do you think you could run that markdown file through a Lorem Ipsum converter like https://loremizr.monkeymatt.com/ (to remove any actual content in the file that you wouldn't want to share publicly) and then share the loremized file? Having access to that file's Markdown structure could be quite useful for testing.

@boehs
Copy link
Author

boehs commented Oct 26, 2021

out of curiosity have you tried to reproduce with a generic lorum file with a massive amount of content?

@kdheepak
Copy link

kdheepak commented Jan 9, 2022

I ran into the same issue. If you patch the svelte compiler, it might resolve it for you. See sveltejs/svelte#4694 for more information.

@benmccann
Copy link
Contributor

The issue is hopefully fixed now with the release of Svelte 3.46.4. Could you try again and check if it works now?

@pngwn
Copy link
Owner

pngwn commented Feb 4, 2022

@kdheepak @boehs Is this issue resolved with the current version of svelte?

@kdheepak
Copy link

kdheepak commented Feb 4, 2022

Yes, for me it has!

@pngwn pngwn closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🕵️ I'm looking into it
Projects
None yet
Development

No branches or pull requests

5 participants