jsx-control-statements icon indicating copy to clipboard operation
jsx-control-statements copied to clipboard

@babel/runtime": "^7.0.0-beta.44

Open pgiani opened this issue 7 years ago • 4 comments

Hi

Im just update my meteor app to 1.7 and it apreas that the "@babel/runtime": "^7.0.0-beta.44" is not compatible with jsx-control-statements, this is the error I get ` While processing files with ecmascript (for target os.osx.x86_64):

/Users/pgiani/.meteor/packages/ecmascript/.0.10.9.lh7yb3.pdla++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/types/lib/definitions/utils.js:128:13: Property arguments[5] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName"] but instead got "JSXSpreadChild" at validate at Object.compile (packages/babel-compiler.js:51:29) at packages/babel-compiler.js:184:22 at Function.time (/tools/tool-env/profile.js:305:10) at profile (packages/babel-compiler.js:232:20) at BabelCompiler.BCp.processOneFileForTarget (packages/babel-compiler.js:183:20) at BabelCompiler. (packages/babel-compiler.js:111:26) at Array.forEach () at BabelCompiler.BCp.processFilesForTarget (packages/babel-compiler.js:110:14) `

my .babelrc { "plugins": ["transform-class-properties", "jsx-control-statements"] }

Any ideas on why is the error occurring, thanks

pgiani avatar Jun 01 '18 04:06 pgiani

Are you sure this is us? Could you provide the code that it's failing on or a link to the repo?

I'm not aware of jsx-control-statements generating JSXSpreadChild anywhere :/.

AlexGilleran avatar Jun 01 '18 05:06 AlexGilleran

Appears related to this https://github.com/babel/babel/issues/7069

But I still don't understand how we'd be creating it :|

AlexGilleran avatar Jun 01 '18 05:06 AlexGilleran

@AlexGilleran: We use buildChildren, which needs to be fixed, as mentioned here: https://github.com/babel/babel/issues/7069#issuecomment-352924174

texttechne avatar Jun 04 '18 14:06 texttechne

Sorry took so long to reply, I never got a notification from this tread

Here is the repo https://github.com/pgiani/meteor_jsx-control-statements

the code inside the IF should not render

class Main extends React.Component {
    render() {
      return (

        <div>
          Before IF
          <br />
          <br />
          <If condition={false}>
            <span>SHOULD NOT SHOW</span>
          </If>
          <br />
          <br />
          After IF
        </div>
      );
    }
  }

But it does show this

Before IF

false ? SHOULD NOT SHOW : null

After IF 

it show no errors on the console, the error only show on my complete app where the IF is doing some more complex actions

pgiani avatar Jun 16 '18 23:06 pgiani