Problem with babel-plugin-jsx-control-statements after pulishing

Hi,

as stated in the title - I am using the babel-plugin-jsx-control-statements (babel-plugin-jsx-control-statements - npm) and everything works fine as long as I run the app locally. But unfortunately after publishing the app via exp publish --release-channel I get an error that the variable choose can’t be found - which is part of the jsx-control plugin.

Do I need to configure something to use a Babel plugin for the published build via Expo?

Thx in advance!

you’d need to post your babelrc. my guess is you just put it under the development key in babelrc

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": ["jsx-control-statements","transform-react-jsx-source"]
    }
  }
}

Yeap, you are right.
Thanks for the quick help!

1 Like

I’ve tried it now with these two versions:

{
  "env": {
    "development": {
      "presets": ["babel-preset-expo"],
      "plugins": ["jsx-control-statements","transform-react-jsx-source"]
    },
    "production": {
      "presets": ["babel-preset-expo"],
      "plugins": ["jsx-control-statements","transform-react-jsx-source"]
    }
  }
}

{
  "presets": [
    "babel-preset-expo"
  ],
  "plugins": [
    "jsx-control-statements"
  ]
}

But the error is still the same… - @notbrent could you give me a hint what is wrong?

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": ["jsx-control-statements","transform-react-jsx-source"]
    },
    "production": {
      "plugins": ["jsx-control-statements"]
    }
  }
}

then restart the packager with exp start -c

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.