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

Error: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. #331

Closed
Moodax opened this issue Jan 27, 2022 · 6 comments

Comments

@Moodax
Copy link

Moodax commented Jan 27, 2022

When trying to implement your component, I get this error:

./node_modules/@miblanchard/react-native-slider/lib/index.js 53:22
Module parse failed: Unexpected token (53:22)
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
| }
| if (Array.isArray(values) && Array.isArray(newValues)) {

    return values?.map((value, index) => {

| let valueToSet = newValues[index];
| if (value instanceof Animated.Value) {

I used the same implementation as shown in example.

@miblanchard
Copy link
Owner

Looks like your webpack config is not set up to handle optional chaining. You could add this dependency to the includes section of your webpack config. That will likely resolve the issue.

@Moodax
Copy link
Author

Moodax commented Jan 28, 2022

I think you're right, but I can't seem to find a tutorial on how to install webpack for React Native, and adding optional chaining plugin to Babel didn't make any difference. Can you please link me some easy to understand tutorial for webpack installation?
Thanks in advance!

@miblanchard
Copy link
Owner

@Moodax This babel config works for my use cases.

return {
        plugins: ["@babel/plugin-proposal-export-namespace-from"],
        presets: [
            "module:metro-react-native-babel-preset",
            "@babel/preset-typescript",
        ],
    };
    

@miblanchard
Copy link
Owner

@Moodax I'm going to close this because it's not a problem with this library and can be resolved via babel.

@brucedk
Copy link

brucedk commented Mar 5, 2022

Same issue here... and babel config does not work

@brucedk
Copy link

brucedk commented Mar 5, 2022

@Moodax
I managed to get working using this example, just change the name of the package

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

3 participants