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

Getting Build Error of node_module custom lib png file #420

Closed
sunilyadavfabhotel opened this issue Jul 3, 2024 · 2 comments
Closed

Getting Build Error of node_module custom lib png file #420

sunilyadavfabhotel opened this issue Jul 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sunilyadavfabhotel
Copy link

sunilyadavfabhotel commented Jul 3, 2024

*Description
In build logs it says BUILD SUCCEEDED but the app has a png file error of our custom UI lib
Screenshot 2024-07-03 at 6 13 23 PM

Screenshot 2024-07-03 at 6 13 53 PM

I have tried to add react-native.metro.js file in lib but its still not able to pick the assets of our lib and keep failing and saying build error and in debug terminal it say BUILD SUCCEEDED

@sunilyadavfabhotel sunilyadavfabhotel added the bug Something isn't working label Jul 3, 2024
@jakub-gonet
Copy link
Member

Are you able to share your metro config here? We're overriding some keys in there, maybe you project's setting for assets gets dropped.

@sunilyadavfabhotel
Copy link
Author

@jakub-gonet here is metro file,

const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

const defaultConfig = getDefaultConfig(__dirname);

const {
resolver: {sourceExts, assetExts},
} = getDefaultConfig(__dirname);

const config = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
},
};

module.exports = mergeConfig(defaultConfig, config);

**After the React Native update, and adding lib location in TS config file, its got fixed so closing this issue **

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants