Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[xdl] set EXPO_TARGET to correct value when starting dev server #2250

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

esamelson
Copy link
Contributor

@esamelson esamelson commented Jun 11, 2020

When trying to publish a project from inside expo/expo, I am getting the following error:

Error: Invalid target: 'undefined'. Debug info:
{
  "EXPO_TARGET": "undefined",
  "default": "managed"
}
    at getDefaultConfig (/Users/eric/.volta/tools/image/packages/expo-cli/3.21.5/node_modules/@expo/metro-config/src/ExpoMetroConfig.ts:45:11)
    at Object.loadAsync (/Users/eric/.volta/tools/image/packages/expo-cli/3.21.5/node_modules/@expo/metro-config/src/ExpoMetroConfig.ts:107:23)
    at runMetroDevServerAsync (/Users/eric/.volta/tools/image/packages/expo-cli/3.21.5/node_modules/@expo/dev-server/src/MetroDevServer.ts:17:45)
    at startDevServerAsync (/@expo/xdl@57.9.13/src/Project.ts:2166:32)
    at Object.startAsync (/@expo/xdl@57.9.13/src/Project.ts:2406:5)
    at action (/Users/eric/.volta/tools/image/packages/expo-cli/3.21.5/src/commands/publish.ts:103:5)
    at Command.<anonymous> (/Users/eric/.volta/tools/image/packages/expo-cli/3.21.5/src/exp.ts:80:7)

Digging in, it looks like this is caused by setting the EXPO_TARGET env var to a value that is always undefined -- which actually causes it to be read as the string "undefined" by @expo/metro-config. Changing this to the correct value fixed the issue and let the publish succeed.

@esamelson esamelson requested a review from fson June 11, 2020 19:11
@fson
Copy link
Contributor

fson commented Jun 12, 2020

Thanks for fixing this! 👍

@fson fson merged commit e106afa into master Jun 12, 2020
@fson fson deleted the @eric/fix-publish branch June 12, 2020 08:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants