-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Constants.manifest is broken and so is Constants.expoConfig #19762
Comments
As mentioned in Expo Documentation, once |
In case it helps someone, I did now end up with function getExtra(constant: string) {
for (const extra of [Constants.manifest?.extra, Constants.manifest2?.extra, Updates.manifest?.extra]) {
const c = extra?.[constant] ?? extra?.expoClient?.extra?.[constant];
if (c) return c;
}
throw new Error(`constant ${constant} not found in manifest.`);
} So there are six possible places and I'm not sure which one is there when.
|
can someone share a reproducible example that demonstrates the issue with |
Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue. The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue. A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own. ResourcesCommon concerns"I've only been able to reproduce it in private, proprietary code"You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase. "I didn't have time to create one"That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template. "You can reproduce it by yourself by creating a project and following these steps"This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue. |
The original post mentioned using Expo SDK 44. |
This doesn't work at all on Metro web |
@events-jonas-chrisw Could you please be more precise? |
When i use expo constants on android or IOS, Constants.expoConfig has a complete object. |
@events-jonas-chrisw Thank you. I'll take a look when I have some time. If investigating this in a timely manner is important to you I recommend having a look at the code and seeing if you can't figure out what the cause is / what's going on. |
@events-jonas-chrisw Constants.expoConfig on web for SDK 49 requires the Expo Router Babel plugin. In SDK 50+ (upcoming), the Expo (not Expo Router) Babel plugin will have support for Constants.expoConfig built in. |
Summary
Constants.manifest?.version
always returns undefinedConstants.manifest?.ios?.buildNumber
always returns undefinedConstants.manifest?.android?.versionCode
also always returns undefinedReplacing
manifest
withexpoConfig
does not work.Please can someone tell me what the new way to do this is? I need it for debugging and support.
What platform(s) does this occur on?
Android
Environment
expo-env-info 1.0.5 environment info:
System:
OS: Windows 10 10.0.19044
Binaries:
Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 3.2.0 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-213.7172.25.2113.9123335
npmPackages:
@expo/metro-config: ^0.1.40 => 0.1.84
babel-preset-expo: 9.0.2 => 9.0.2
expo: ^44.0.0 => 44.0.6
react: 17.0.1 => 17.0.1
react-native: https://github.com/expo/react-native/archive/sdk-44.0.0.tar.gz => 0.64.3
react-navigation: ^4.4.0 => 4.4.4
Expo Workflow: managed
Minimal reproducible example
The text was updated successfully, but these errors were encountered: