oliviertassinari / babel-plugin-transform-react-remove-prop-types

Remove unnecessary React propTypes from the production build. :balloon:
MIT License
897 stars 61 forks source link

Range error: Maximum call stack size exceeded #139

Closed jamesplease closed 6 years ago

jamesplease commented 6 years ago

Hi there, I am running into a problem where this plugin causes the issue that is in the title to appear.

To reproduce:

  1. clone React Composer
  2. git reset --hard e22b5e1a37e26b4f54e8
  3. npm run build:umd:min
  4. observe the error

The Babel configuration is:

{
  "presets": [["env", { "modules": false }], "stage-3", "react"],
  "plugins": [
    "external-helpers",
    "transform-class-properties",
    [
      "transform-react-remove-prop-types",
      {
        "mode": "remove",
        "removeImport": true
      }
    ]
  ]
}

Oddly, I use this same setup on a number of other projects and so far I haven't run into issues. But maybe I am doing something wrong 🙂

I am still debugging this problem, but I figured I would open an issue here in case someone else runs into the problem, or was interested in helping troubleshoot.

Thanks!


Notes: Babel is being used as a Rollup plugin in this situation.

jamesplease commented 6 years ago

I am going to close this; it seems more likely to be a Rollup problem than a problem here.