I am trying to get Nativewind to work on my expo react-native project. But i keep getting the following error:
iOS Bundling failed 3618ms (C:Documentsprojectnode_modulesexpo-routerentry.js) error: appindex.jsx: [BABEL] C:Documentsprojectappindex.jsx: .plugins is not a valid Plugin property
This is my babel.config.js
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: ["nativewind/babel"], //The error no longer appears if I comment out this line.
};
};
And my tailwind.config.js
// tailwind.config.js
module.exports = {
content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
};
I have tried removing the plugins property, but then nativewind doesnt work. I am following along with the nativewind quick start documentation but haven’t seen any mention of this kind of issue.
2
Answers
It appears like there could be an issue with how the nativewind/babel plugin is designed in your Expo Respond Local venture.
Guarantee that the version of native wind/babel you’re utilizing is congruous along with your Expo and Respond Local forms.
Attempt overhauling your babel.config.js to expressly indicate the babel- plugin- native wind plugin rather than using native wind/babel.
How you’ll do it:
// babel.config. js
module.exports = work (api) {api.cache(true);
return {presets:["babel- preset- expo"],plugins:["babel – plugin – native wind"], // Overhaul this line};};
1.Check Conditions:
Make beyond any doubt all conditions, counting babel- plugin- native wind, are correctly introduced and up to date. You’ll be able attempt expelling the node_modules registry and reinstalling conditions by running npm introduce or yarn introduce.
2.Expo Compatibility:
Affirm that the native wind bundle is consistent with Expo ventures. Now and then, certain libraries or plugins may not be completely congruous with Expo’s overseen workflow.
3. Expo Documentation:
Check the Expo documentation or community gatherings to see in case there are any known issues or arrangements related to utilizing native wind with Expo ventures.
Check this for a solution. You have to downgrade nativewind to v2.0.11 because thats the last stable version. Version releases are listed in the nativewind repo.