question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[react-native + automatic jsx transform] RangeError: Maximum call stack size exceeded

See original GitHub issue

Hi,

Before we used why-did-you-render without automatic jsx transform and it worked good. However, after adding babel-plugin-transform-react-jsx the library doesn’t seem to be working. I’ve tried to do everything as per readme, but since the project is written in react-native I had to change some lines of code. Here is my config:

module.exports = function BabelEnvConfiguration(api) {
  api.cache(true);

  const isDev = process.env.BABEL_ENV === "development";

  const config = {
    presets: [
      // `useTransformReactJSXExperimental` is needed here in order to exclude
      // `plugin-transform-react-jsx-source` and `plugin-transform-react-jsx-self`
      // because they will be injected by `@babel/plugin-transform-react-jsx-development`
      ["module:metro-react-native-babel-preset", { useTransformReactJSXExperimental: true }],
    ],
    plugins: [
      !isDev // since we can not pass `development` as in `@babel/preset-react`, I'm using ternary operator here
        ? [
            "@babel/plugin-transform-react-jsx",
            {
              runtime: "automatic",
            },
          ]
        : [
            "@babel/plugin-transform-react-jsx-development",
            {
              runtime: "automatic",
              importSource: "@welldone-software/why-did-you-render",
            },
          ],
    ],
  };

  return config;
};

And I’m getting RangeError: Maximum call stack size exceeded error 😔 (stacktrace is below)

image

I’m pretty sure I’m missing something important but I can not understand what’s exactly 🙂 I hope you will give a direction for further investigation, because I’ve tried everything that is possible and it still doesn’t work.

Thank you for your help in advance!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
mduthilleulcommented, Nov 16, 2021

Can’t help but I can report I have the same issue on my projet. RN 0.66.1, React 17.0.2, also with useTransformReactJSXExperimental.

2reactions
grgmocommented, Nov 15, 2022

not working either with RN 0.70.05, React 18, wdyr 7.0.1, anyone able to run on RN not using expo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Calling useState inside a function causes maximum call stack ...
I am trying to set the data returned from firebase in useState variable but I got maximum call stack size exceeded error in...
Read more >
[Solved]-React For Loop - Uncaught (in promise) RangeError
Coding example for the question React For Loop - Uncaught (in promise) RangeError: Maximum call stack size exceeded-Reactjs.
Read more >
React native - Maximum call stack size exceeded - Reddit
Maximum call stack error is likely caused by recursive function calls causing an infinite recursion. Binding and reference not being released ...
Read more >
React-native debugging error: Maximum call stack size ...
Sometimes calling a recursive function over and over again, causes the browser to send you Maximum call stack size exceeded error message as...
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