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

#1

Hi,

as stated in the title - I am using the babel-plugin-jsx-control-statements (https://www.npmjs.com/package/babel-plugin-jsx-control-statements#installation) 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!

#2

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

#3
{
  "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
#4

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?

#5
{
  "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
closed #6

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