-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
In Bare, Linking crashes with null is not an object (evaluating 'manifest.hostUri') #10095
Comments
This issue is open for a long time now (#7721 closed without a fix, #8973 assigned since August 11th to https://github.com/esamelson) ... what is the problem ? |
Taking a look at this @lc3t35 , thanks for reporting |
In Bare that expo/packages/expo-linking/src/Linking.ts Lines 24 to 31 in ec8bdb6
Quick workaround would be checking if manifest exists. However this should also be done in - if (!manifest.hostUri && !usesCustomScheme()) {
+ if (!(manifest?.hostUri) && !usesCustomScheme()) { However, the method still accesses |
|
I'll chime in here and say that I'm facing this issue too. I'd been seeing some errors about it in Sentry for a few weeks and finally was able to track it down to this. Honestly, for now I'm thinking I'll just stop using Btw, for other issues with bare that I've since forgotten I needed to monkey-patch import * as manifest from '../../app.json';
if (!Constants.manifest) {
Constants.manifest = {
...manifest.expo,
id: '...',
} as any;
} But since const { manifest } = Constants; |
update to latest expo-linking: 1.0.5 |
Unfortunately that didn't fix the issue, it's still there. Notice that this is related to |
Error happens when calling |
sorry this issue has been closed for a while, if you're still encountering a similar problem then please create a new issue and fill out the issue template so we have enough information to help :) |
🐛 Bug Report
Summary of Issue
In Bare (sdk38), Linking crashes with
null is not an object (evaluating 'manifest.hostUri')
Environment - output of
expo diagnostics
& the platform(s) you're targetingReproducible Demo
Not easy as it's a bare project.
Similar issue #7807
Steps to Reproduce
Open the link, the app is launched, linking is handled by getInitialURL or addEventListener then parsing crashes
url is correct : scheme://join?memberId=xxx
Expected Behavior vs Actual Behavior
Previous version with sdk35 did not crash.
As mentioned in expo-notification README,
"Defaults to [
Constants.manifest.id](https://docs.expo.io/versions/latest/sdk/constants/#constantsmanifest) exposed by
expo-constants. You may need to define it in bare workflow, where
expo-constantsdoesn't expose the manifest."
https://github.com/expo/expo/blob/master/packages/expo-linking/src/Linking.ts imports expo-constants
So that's why it is broken in bare workflow ....
How can we urgently solve this ?
Quickfix until solved
I just need path and queryParams, so I replaced Linking.parse(url) with
The text was updated successfully, but these errors were encountered: