radio-buttons-react-native icon indicating copy to clipboard operation
radio-buttons-react-native copied to clipboard

Question for compile failure of example code

Open tk-dev0927 opened this issue 4 years ago • 4 comments

Hi,

I got an error, "Failed to compile" when I run the example code. I am new to React Native and the error location is not in the example code. So I wonder if this is module problem.

Failed to compile C:/ReactNative/TestApp/node_modules/radio-buttons-react-native/RadioButtonRN.js 101:20 Module parse failed: Unexpected token (101:20) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | } |

fadeInAnimation = () => {

| // this.fadeAnim.setValue(0) | Animated.timing(this.state.fadeAnim, { This error occurred during the build time and cannot be dismissed.

tk-dev0927 avatar Apr 19 '20 23:04 tk-dev0927

Same problem. Any solution to this problem yet?

afamgit avatar Jul 19 '20 13:07 afamgit

Found a fix that works on my expo project. Just create a webpack.config.js file with the following content:

const createExpoWebpackConfigAsync = require("@expo/webpack-config");

module.exports = async function (env, argv) {
  const config = await createExpoWebpackConfigAsync(
    {
      ...env,
      babel: {
        dangerouslyAddModulePathsToTranspile: [
          // Ensure that all packages starting with @evanbacon are transpiled.
          "RadioButtonRN",
        ],
      },
    },
    argv
  );
  return config;
};

Answer from this links https://github.com/expo/expo-cli/tree/master/packages/webpack-config#include-modules

ceessay avatar Jul 24 '20 23:07 ceessay

Any solution?

Vibinreji avatar Jan 24 '21 18:01 Vibinreji

@ceessay I was having the same problem and this worked for me. Thanks!

daraujo-etg avatar May 19 '22 19:05 daraujo-etg