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

Commit

Permalink
Return default entry point if it cannot be resolved using our helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
brentvatne committed Apr 16, 2020
1 parent 57abd9f commit e076d56
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/config/src/paths/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ export function getEntryPointWithExtensions(
if (!entry) {
// Allow for paths like: `{ "main": "expo/AppEntry" }`
entry = resolveFromSilentWithExtensions(projectRoot, exp.entryPoint, extensions);
if (!entry)
throw new Error(
`Cannot resolve entry file: The \`expo.entryPoint\` field defined in your \`app.json\` points to a non-existent path.`
);

// If it doesn't resolve then just return the entryPoint as-is. This makes
// it possible for people who have an unconventional setup (eg: multiple
// apps in monorepo with metro at root) to customize entry point without
// us imposing our assumptions.
if (!entry) {
return exp.entryPoint;
}
}
return entry;
} else if (pkg) {
Expand Down

0 comments on commit e076d56

Please sign in to comment.