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

Unable to resolve module missing-asset-registry-path #1368

Open
A-Kasaaian opened this issue Oct 9, 2024 · 3 comments
Open

Unable to resolve module missing-asset-registry-path #1368

A-Kasaaian opened this issue Oct 9, 2024 · 3 comments

Comments

@A-Kasaaian
Copy link

A-Kasaaian commented Oct 9, 2024

Do you want to request a feature or report a bug?
bug

What is the current behavior?
I see following error when I build production bundle

Error: Unable to resolve module missing-asset-registry-path from /Users/XXX/Develop/XXX/node_modules/@react-navigation/elements/lib/commonjs/assets/back-icon-mask.png: missing-asset-registry-path could not be found within the project or in these directories:
  node_modules/@react-navigation/elements/node_modules
  node_modules
> 1 | �PNG
  2 | 
  3 | 
  4 | IHDR2���gAMA��
                    �a cHRMz&�����u0�`:�p��Q<bKGD���̿tIME�
  2 | 
  3 | 
  4 | IHDR2���gAMA��
                    �a cHRMz&�����u0�`:�p��Q<bKGD���̿tIME�.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
on react native project
cd android && ./gradlew bundleRelease

What is the expected behavior?
Metro should process images

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

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

const config = {
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config)

I have already tried most of configs shared on this repo and react-native repo or stackoverflow.

@robhogan
Copy link
Contributor

Hi @A-Kasaaian, you don't mention what versions of RN/Metro/(Expo?) you're using, which might be helpful, but that looks like your configuration isn't being picked up at all - ie the CLI isn't finding your config file.

What's your project structure and what's the name and location of your config file?

@A-Kasaaian
Copy link
Author

A-Kasaaian commented Oct 10, 2024

All was working on RN 70.6 but I had to upgrade packages. I ended up with current latest versions of metro and RN (75.4).

I had the same error for my project images but I resolved them by changing Image attribute source ={require('@assets/image.png')} to source={{ uri: '@assets/image.png'}}.

@robhogan
Copy link
Contributor

I'm not sure whether you're saying this can be closed?

If not could you describe your project structure and Metro config path?

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

2 participants