DEV Community

negue
negue

Posted on

2

ERROR in Maximum call stack size exceeded - the unsual kind

Wow.... who would've known that the next issue would be right at the corner so soon. 😁

I'm working on a markdown component, and I needed a list of colon emoji keys's (:smile:) to have simple overview for them 😄

While angular was running, I created this > file < nothing happened.

When I imported it...

ERROR in RangeError: Maximum call stack size exceeded happened

.... ok what ... why?!

Usually this error means, some module imported a different one which imported the previous one, which imported "the different"-one ... and so on.

Or it means just any methods called itself until the stack exceeded, but it wasn't a runtime error, it was a compiler error.

Ok. Weird.

What did I do before it... "just added a file"... right?

To make sure it is not a hiccup again, I restarted angular/typescript.

The error still happens.

Removed the file and its working again?!

Lets try to debug it again.

Added the file back and started angular in verbose mode.

ERROR in RangeError: Maximum call stack size exceeded
    at needsIndentation 
        function needsIndentation(parent, node1, node2) {
            parent = skipSynthesizedParentheses(parent);
            node1 = skipSynthesizedParentheses(node1);
            node2 = skipSynthesizedParentheses(node2);

Sadly I haven't took a deep-dive into typescript (yet), but today wouldn't be the day either 😁, but maybe there was already anything anywhere => searched for the first 2 lines, but I couldn't find anything useful.

Solution. 🎉

Use an array of strings and then just .join() them together. > Gist <

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay