douglasjunior / react-native-keyboard-manager

⚛ Library to prevent issues of keyboard sliding up and cover inputs on React-Native iOS projects.
https://www.npmjs.com/package/react-native-keyboard-manager
MIT License
952 stars 60 forks source link

Showing Recent Issues error node_modules/react-native-keyboard-manager/index.js: Cannot find module 'babel-preset-react-native' #101

Closed faisal-ali12 closed 1 year ago

faisal-ali12 commented 1 year ago
Screenshot 2023-04-14 at 11 55 55 AM

Outdated : https://www.npmjs.com/package/babel-preset-react-native

douglasjunior commented 1 year ago

Sorry, but this library has nothing to do with babel, this is a problem with your environment or babel config.

faisal-ali12 commented 1 year ago

@douglasjunior it not a environment issue, you are using Deprecated version by adding .babelrc this file "babel-preset-react-native", the newer version https://github.com/facebook/metro/tree/main/packages/metro-react-native-babel-preset

Please read and do research before closing the PR out. Thanks

douglasjunior commented 1 year ago

This Babel file should not be loaded from within the node_modules, so I think it is some special config of your environment. (We use this lib in many projects, from RN 0.60 to 0.71 and never had issues like that)

Anyway, if this file is really a problem, the proper solution is to add it to .npmignore and not remove it.

faisal-ali12 commented 1 year ago

@douglasjunior but still you are using outdate file in your project and can you update that ? it will solve all the issue. it bad to remove any file form node_module.

you just need to update babel preset which is deprecated.

Screenshot 2023-04-14 at 2 40 58 PM

douglasjunior commented 1 year ago

As I said earlier, this preset is not used by the lib directly, but only during the development of the lib.

Therefore, we shouldn't worry about it now.

douglasjunior commented 1 year ago

I didn't tell you to remove the file from your node_modules, I said the correct fix would be to add it to the lib's npmignore.

However, I insist that it is strange that this file is affecting the build of your project.

If you can provide a project where the issue is reproduced I would be happy to help.