Comments (10)
As a workaround you can use mock the could not found module @sebas21 @maluramichael
jest.mock('react-native-share', () => {
return {
NativeRNShare: () => {},
};
});
from react-native-share.
As a workaround you can use mock the could not found module @sebas21 @maluramichael
jest.mock('react-native-share', () => { return { NativeRNShare: () => {}, }; });
Thanks a lot. This helped me so much.
from react-native-share.
Happens to me when running the app (not only tests) since 9.0.0. 8.2.2 is the latest release i can use in my project.
from react-native-share.
I think this is the same problem we got in our tests. They fail right now and i don't know how to work around it.
- "react-native-share": "^9.2.3"
- "react-native": "0.71.12"
● Test suite failed to run
Cannot find module '../codegenSpec/NativeRNShare' from 'node_modules/react-native-share/lib/commonjs/index.js'
Require stack:
node_modules/react-native-share/lib/commonjs/index.js
app/helper/Image.js
app/components/stateless/atomic/CachedImage/index.js
app/components/stateless/atomic/ProfileImage/index.js
app/components/stateless/atomic/ProfileImage/test.js
13 | import { Image } from 'react-native';
14 | import imageCacheHoc from 'react-native-image-cache-hoc';
> 15 | import Share from 'react-native-share';
| ^
16 |
17 | import Api from '@constants/Api';
18 | import { THUMBNAIL_API } from '@constants/Api';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:491:11)
at Object.require (node_modules/react-native-share/lib/commonjs/index.tsx:1:1)
at Object.require (app/helper/Image.js:15:1)
at Object.require (app/components/stateless/atomic/CachedImage/index.js:25:1)
at Object.require (app/components/stateless/atomic/ProfileImage/index.js:19:1)
at Object.require (app/components/stateless/atomic/ProfileImage/test.js:12:1)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)
from react-native-share.
@maluramichael Friend, could you solve it?
from react-native-share.
@maluramichael Friend, could you solve it?
sadly no.
from react-native-share.
Quick workaround with react-native-share: 10.0.2
and react-native: 0.73.1
Wrong path is being imported,
Open node_modules/react-native-share/lib/commonjs/index.js
file,
find ../codegenSpec/NativeRNShare
and replace it with ../../codegenSpec/NativeRNShare
from react-native-share.
I also needed to patch helpers/android.js
(from ../../
to ../../../
), there was import of NativeRNShare
as well. I'm on React Native 0.73.2 and react-native-share: 10.0.2
from react-native-share.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open
from react-native-share.
🎉 This issue has been resolved in version 10.2.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
from react-native-share.
Related Issues (20)
- SMS on iOS fails to open HOT 2
- File sharing from internal storage to external storage - Android 14 HOT 1
- Does this library support the sharing method using App extension libiary? HOT 2
- "Save" button is white, not clear HOT 1
- Share.open saying it needs 3 arguments and only received 1 - ios HOT 1
- shareSingle fb messenger on IOS, empty link and no preview HOT 2
- TargetChosenReceiver.getSharingSenderIntent
- Share button doesn't do anything on Android HOT 4
- Facebook opens in browser, X, both broken. HOT 3
- Unable to share multiple PDF and DOC files to Slack from React Native app. HOT 1
- shareResponse always returning false.
- Sharing PDF File On Whatsapp Error On IOS In Release Build HOT 2
- Share.open exclude message for instagram HOT 2
- share button doesnt do anythinn in android 14
- Cannot run build ios with use_framework static
- Specify zoom of picture when sharing to instagram stories
- Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNShare' could not be found. HOT 2
- Share.shareSingle `Instagram` only opens AppStore, does not post to Instagram HOT 8
- How to Share a Link with a Pre-filled Message Text to Messenger in React Native?
- ios build fail with rn 0.75.2 and New Arch enabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-share.