Skip to content

Commit

Permalink
fix: format error message for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Jul 4, 2021
1 parent f04bb0d commit 94f58d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ export function isThenable(value: unknown): value is Promise<unknown> {

export function verifyRef(ref: unknown) {
if (ref === undefined) {
throw new Error(
`Received undefined as a type ref. This is often caused by circular import. In some cases this can be fixed by importing the type ref directly from the file that defines it rather than an index file`,
);
throw new Error(`Received undefined as a type ref.
This is often caused by a circular import
If this ref is imported from a file that re-exports it (like index.ts)
you may be able to resolve this by importing it directly fron the file that defines it.
`);
}
}

0 comments on commit 94f58d4

Please sign in to comment.