Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question for compile failure of example code #2

Open
tk-dev0927 opened this issue Apr 19, 2020 · 4 comments
Open

Question for compile failure of example code #2

tk-dev0927 opened this issue Apr 19, 2020 · 4 comments

Comments

@tk-dev0927
Copy link

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.

@afamgit
Copy link

afamgit commented Jul 19, 2020

Same problem. Any solution to this problem yet?

@ceessay
Copy link

ceessay commented Jul 24, 2020

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

@Vibinreji
Copy link

Any solution?

@daraujo-etg
Copy link

daraujo-etg commented May 19, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants