Report actionable internal resolution errors#278
Conversation
🦋 Changeset detectedLatest commit: 15db114 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
andrewbranch
left a comment
There was a problem hiding this comment.
Thank you, this is looking good! I have a couple small suggestions that will hopefully make the output slightly more readable.
|
|
||
| './core' failed to resolve for entrypoint '@apollo/client' using node16-cjs with conditions 'import', 'types', 'node' from declaration '/node_modules/@apollo/client/index.d.ts': Module name './core' was not resolved. |
There was a problem hiding this comment.
Let's indent the start of each of these so it's more clear that they're sub-elements of the message above. Also, the "Module name './core' was not resolved." seems to be redundant with the rest of the message, so we can probably remove it.
There was a problem hiding this comment.
Indented the summary lines under the description and dropped the redundant Module name … was not resolved. tail. New form: './core' failed to resolve using node16-cjs from '/node_modules/@apollo/client/index.d.ts'.
Indent and dedupe the internal-resolution summary lines across entrypoints, and drop the redundant entrypoint, "declaration", conditions, and resolver-message text from each human-readable line. Table cells and the JSON/structured fields are unchanged.
| function formatInternalResolutionError(problem: core.InternalResolutionErrorProblem): string { | ||
| return `${quote(problem.moduleSpecifier)} failed to resolve using ${problem.resolutionKind} from ${quote( | ||
| problem.fileName, | ||
| )}`; |
InternalResolutionErroronly pointed users to-f json, so the actual resolution failure stayed hidden in the original CI run. The default output now reports the failing specifier, resolution kind, and declaration file;--verboseadds the full trace and JSON exposes the same fields. Repeated failures that share a specifier, resolution kind, and declaration file are deduplicated across entrypoints in the summary. Existing problem fields and other problem kinds are unchanged. Fixes #257