Skip to content

fix(deno): recognize the npm-referrer miss that names the owning package - #3563

Merged
kojiwakayama merged 1 commit into
mainfrom
fix/dx-20260811-b2-0
Aug 11, 2026
Merged

kojiwakayama merged 1 commit into
mainfrom
fix/dx-20260811-b2-0

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Found during a DX dogfood walk of https://veryfront.com/docs/code/getting-started/installation, which advertises Deno as a first-class runtime (deno add npm:veryfront, "Deno 1.45 or later").

Symptom

The published veryfront CLI was dead on arrival under Deno. Every command exited 1 before anything bound:

$ deno install -g -A -f -n veryfront npm:veryfront
$ veryfront dev
  Veryfront (v0.1.1228)
  ✗ [unknown-error] Unknown/unclassified error
    Detail: Could not find package '@veryfront/ext-auth-jwt' from referrer
    '…/esm/src/extensions/first-party-import.js' (veryfront@0.1.1228).

Installing the named package only advanced the chain to the next one (@veryfront/ext-db-sqlite, …). The same node_modules tree started fine under Node.

Root cause

Not a missing dependency. The root npm package depends only on STANDARD_ROOT_NPM_EXTENSION_DIRECTORIES by design (src/extensions/first-party-defaults.ts) — the other first-party extensions are builtin-deferred/builtin-direct and are meant to degrade to "not installed" when absent. loadOptionalBuiltinExtension already implements that skip, gated on isMissingFirstPartyExtensionModule, which classifies a failed dynamic import by parsing the runtime's message.

#3560 landed the bare Deno npm-resolver shape while this branch was open:

Could not find package 'X' from referrer 'Y'.

That covers deno task dev in a scaffolded project, where the referrer sits in a local node_modules/.deno/… tree. It does not cover the documented global install path. When the referrer resolves out of the global Deno npm cache — deno add npm:veryfront, deno install -g npm:veryfront — Deno appends the owning package identifier:

Could not find package 'X' from referrer 'Y' (veryfront@0.1.1228).

The trailing parenthetical leaves the message unparsed, reportedMissingSpecifier returns undefined, the error is not recognised as "extension not installed", and it is rethrown as fatal. So on the documented install path the intentional optional-extension split still turned into a hard startup crash on the first optional extension.

Fix

One optional group on the pattern #3560 added: (pkg@version). Nothing else changes.

Regression test

src/extensions/first-party-import.test.ts, beside the existing per-runtime message-shape cases where this classifier's runtime-message contract is already pinned. It covers the global-cache referrer with the trailing package identifier, plus a negative case proving the suffix does not let a genuinely broken transitive dependency inside an installed extension (Could not find package 'jose' from referrer '…/@veryfront/ext-auth-jwt/…' (@veryfront/ext-auth-jwt@0.1.1228).) be swallowed as "not installed".

Confirmed failing before the fix (false where true is expected) and passing after. Home directory in the fixture referrer is a redacted placeholder; only the message shape is under test.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e8aaf9f-cffe-449d-9e37-775574ba0561

📥 Commits

Reviewing files that changed from the base of the PR and between 2fc6a8e and e755780.

📒 Files selected for processing (2)
  • src/extensions/first-party-import.test.ts
  • src/extensions/first-party-import.ts
📝 Walkthrough

Walkthrough

The change parses Deno npm-resolution errors that include referrer details. Tests verify detection of missing first-party extensions and rejection of missing transitive dependencies.

Changes

Deno extension resolution

Layer / File(s) Summary
Resolution parsing and validation
src/extensions/first-party-import.ts, src/extensions/first-party-import.test.ts
reportedMissingSpecifier extracts package specifiers from Deno errors with optional parenthetical metadata. Tests cover node_modules and Deno-cache referrers and exclude missing transitive dependencies.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Possibly related PRs

Suggested reviewers: kwakayama

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: recognizing Deno npm-referrer errors that identify the owning package.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dx-20260811-b2-0

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fc6a8eca4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/extensions/first-party-import.test.ts Outdated
`deno add npm:veryfront` and `deno install -g npm:veryfront` resolve the
CLI out of the global Deno npm cache. From that referrer Deno appends the
owning package identifier to its resolution failure:

  Could not find package 'X' from referrer 'Y' (veryfront@0.1.1228).

#3560 taught `reportedMissingSpecifier` the bare referrer shape, but the
trailing parenthetical left the message unparsed, so every optional
first-party extension the root npm package deliberately does not depend on
still threw a fatal unclassified error on the documented `deno add` install
path and the published CLI could not start a project.

Extend that one pattern with the optional ` (pkg@version)` suffix. The
transitive-dependency guard is unchanged: a missing `jose` reported from an
installed extension still fails the anchor check and surfaces.

Found during a DX dogfood walk of the published installation docs, which
advertise Deno as a first-class runtime.

Confidence: high

Scope-risk: narrow

Reversibility: clean
@kojiwakayama kojiwakayama changed the title fix: let the Deno CLI skip uninstalled first-party extensions instead of dying fix(deno): recognize the npm-referrer miss that names the owning package Aug 11, 2026
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 3fd70be Aug 11, 2026
57 of 60 checks passed
@kojiwakayama
kojiwakayama deleted the fix/dx-20260811-b2-0 branch August 11, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant