-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Issue with [email protected] on [email protected] with New Architecture #787
Comments
Guten Tag, Hans here! 🍻 Thank you for providing zese details about your issue with react-native-mmkv on react-native-web. It seems like you're facing module resolution errors due to missing file extensions in your imports. To resolve ze errors, try changing your import statements in import './MMKV.js';
import './hooks.js';
import './Types.js'; Let me know if zis helps, or if you still encounter any issues. If you find zis library helpful, consider supporting ze project by becoming a sponsor!
|
(NOBRIDGE) ERROR Error: Failed to create a new MMKV instance: The native MMKV Module could not be found.
Does anyone have any fix for this? |
@chandani-c-simform resolved here #792 |
@enavermate The solution mentioned by you applies to Expo CLI, However I'm facing an issue with React Native CLI. |
What are you using to bundle your web, I am using this in my web project without RN-Web so I am assuming the addition of RN web is irrelevant, it is likely an issue in the config of the bundler and how it is accessing files |
here is my extension resolution order on my web project |
@amutsch It seems slight misunderstanding in this, we are having react native cli project and to add support of web within it we will have to go with react-native-web. It is not reactJS project. For this we will have to go through related webpack config only. However I have tried with solution you have provided, but it doesn't make any difference. May be you can even try it out by adding rn-web in your existing react native project, you might be able to reproduce the issue. |
I had RN-web based project at one point, I ripped it out as I didn't want it but I share significant code. I made the changes that allow react-native-mmkv to work in web without RN-web so I have run 3.2 with and without RN-web in my project. The problem would be in typescript configuration and webpack configuration. based on the stack trace you are reaching into ESM module code from something that wants commonjs |
I’m facing an issue with react-native-mmkv (v3.2.0) on a project using:
React Native: 0.76.5
New Architecture: Enabled
react-native-web: 0.19.12
react-native-mmkv: 3.2.0
The library works as expected on native platforms (Android/iOS), but running the app on the web results in the following errors:
ERROR in ./node_modules/react-native-mmkv/lib/module/index.js 3:0-23
Module not found: Error: Can't resolve './MMKV' in '/Users/example/node_modules/react-native-mmkv/lib/module'
Did you mean 'MMKV.js'?
BREAKING CHANGE: The request './MMKV' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e.g., a module with JavaScript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
ERROR in ./node_modules/react-native-mmkv/lib/module/index.js 4:0-24
Module not found: Error: Can't resolve './hooks' in '/Users/example/node_modules/react-native-mmkv/lib/module'
Did you mean 'hooks.js'?
BREAKING CHANGE: The request './hooks' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e.g., a module with JavaScript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
ERROR in ./node_modules/react-native-mmkv/lib/module/index.js 5:0-31
Module not found: Error: Can't resolve './Types' in '/Users/example/node_modules/react-native-mmkv/lib/module'
Did you mean 'Types.js'?
BREAKING CHANGE: The request './Types' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e.g., a module with JavaScript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
The text was updated successfully, but these errors were encountered: