Skip to content

[experimental] render: refuse a named import its module does not export - #12319

Merged
josephfarina merged 12 commits into
mainfrom
josephfarina/rl-missing-named-import
Nov 18, 2026
Merged

josephfarina merged 12 commits into
mainfrom
josephfarina/rl-missing-named-import

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A page that imports a name its module does not export failed without naming the import, or rendered wrong. A missing Core component (import {Chart} from '@astryxdesign/core') failed with ERR_RENDER_FAILED and React's "Element type is invalid". A missing function the page calls while it loads failed with ERR_RENDER_FAILED and "… is not a function". An import of a package subpath the package does not export (@astryxdesign/core/Chart) failed with Node's error, which names the installed package's absolute path. A missing name the page uses only in its script failed with ERR_RENDER_SCRIPT. A missing name from a StyleX variables module (.stylex) rendered with exit 0: StyleX compiled the value to a variable that nothing defines, so the page showed without that style.

Problem and solution fit

  1. Why it occurs: StyleX replaces a .stylex import with a hashed variable without checking the export, and the import is gone from the compiled module; other missing names surface only in the browser build.
  2. Why it harms the task: the file shows a page that differs from the app, with nothing to say so.
  3. Why that matters: a build of the same page fails, so the render should too.

The render now refuses such a page with ERR_RENDER_COMPILE, as a build refuses it: "The page does not compile (page.tsx, line 1): @astryxdesign/core has no export Chart". It checks each named import of the page's own module files from a .stylex module, from one of the page's own modules, and from an @astryxdesign/* package against that module's exports, after the page imports, or first when the page's import throws. A file the page imports as text (?raw) is not checked. Only uses as values count: a reference counts when it resolves to the import binding (Babel's scope), so a parameter or a local binding of the same name does not, and references in types, export type {…}, export {type …} and a plain re-export (export {ButtonProps}) do not. So import {Button, ButtonProps} without type still renders. Default imports from a module that exists are not checked, nor is a named import from one of the page's own CommonJS modules (no import or export statement, or .cjs), which a bundler reads by interop. An element drawn as a member of an imported name (<Collapsible.Trigger>) whose export has no such member is refused the same way: "(page.tsx, line 3): @astryxdesign/core/Button has no export Button.Icon". The browser build's "No matching export" from one of the page's own files is reported the same way, through the same message builder, naming the file from the project's root. An import of a package subpath the package does not export (named, default or side-effect) is refused the same way: "(page.tsx, line 1): @astryxdesign/core has no export ./Chart", on the server, in StyleX's compile and in the browser build. A named import from any other package that the package does not export is refused only when the page's script is built; a page that draws or calls it as it renders fails with ERR_RENDER_FAILED first. In a TypeScript module a plain re-export (export {ButtonProps}) does not count as a use, so a name the page imports through such a re-export is not checked; in JavaScript it counts. The message names the file and line as the page writes them, with no absolute path.

Expected behavior and authority

astryx experimental render is experimental (spec:AST-017 FR27). The maintainers decided that a page a build refuses is refused.

Smallest restoration

  • foundation/render/page-worker.mjs: the named-import, member and subpath checks, and the refusal message they share; it reads each import's value uses through foundation/render/value-uses.mjs (shared with the missing-package check).
  • foundation/render/client-bundle.mjs: a bundle error may carry the missing import's file, line, names and module, which the worker reports with the same message.
  • A changeset.

Evidence

  • api/render/render.interactive.test.mjs: a missing name from a relative module, from Core's tokens.stylex and a component Core does not have are each refused with file and line; a page with type-only and default imports renders; a module that re-exports an imported type both ways renders; a ?raw file whose text imports a missing name renders; a missing function called while the page loads is refused; parameters and local bindings named like an import render; a Core subpath and a .stylex subpath that Core does not export are refused with file and line; a multi-line import of a missing name used only in the script is refused with its file and line.
  • On a frozen set of generated pages: no page that rendered before is refused, and pages that crashed with React's "Element type is invalid" or a missing export now get a refusal naming the file, the line and the missing name.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/api/render packages/cli/foundation/render.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 11:12pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 11:18 PM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the check now names a missing import and accepts types imported without type, but it refuses two kinds of valid page, the release note misstates the base, and the bundle branch still copies shared code.

  • valueUses counts a name in export type {ButtonProps} or export {type ButtonProps} as a value use (page-worker.mjs:1363), so a local module that re-exports an imported type, which the base renders, now fails with "@astryxdesign/core has no export ButtonProps"; treat a type-only export declaration or specifier as a type position and add a test.
  • missingNamedExports walks every file in localFiles (page-worker.mjs:1392), including a file the page imports as ?raw text (:694), so a page that shows a sample whose own import is missing is refused and the sample's modules are loaded; check only files the page loads as modules.
  • The changeset says such pages "rendered with exit 0 and broke in the browser", but on the base a missing Core component failed with ERR_RENDER_FAILED and other missing names with ERR_RENDER_SCRIPT (only .stylex rendered), and a name the page calls while it loads (const label = makeLabel(a)) still fails with ERR_RENDER_FAILED; reword the note, and either run the check before classify when the page import throws or narrow the claim to names used while the page renders.
  • client-bundle.mjs:330 reads the module with a one-line copy of importedFrom, so a multi-line import reads "its module has no export nope", and the bundle branch names the file from the page's folder while the server check copies compileSite's project-relative naming; build both messages through importedFrom and one naming helper.

Approval also waits on the governing record: no current record states when astryx experimental render refuses a page, so an engineering owner names or adds the clause that covers this behavior, or records the decision by commenting /approve-spec <full head SHA> on this pull request, which the author may do as an engineering owner.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: a page that imports a missing name is refused with ERR_RENDER_COMPILE and a message naming file, line and module: verified for names used while the page renders, from .stylex, local and Astryx modules, and from other packages through the bundle; false for a name used while the page loads, which still fails with ERR_RENDER_FAILED.
  • Claim: only names used as values are checked, so a type imported without type is fine: verified for import specifiers (the test's type-only page and a ColorVarName import render); false for a type re-exported with export type.
  • Claim: before, such a page rendered with exit 0 and broke in the browser: false; the base failed a missing component with ERR_RENDER_FAILED and other missing names with ERR_RENDER_SCRIPT.
  • Claim: before, a missing .stylex value showed the page without that style: verified, the base renders it with exit 0.
  • Claim: StyleX replaces a .stylex import without checking the export, and other missing names surface only in the browser build: the first is verified; the second is partly true, since a missing component fails in the server render.
  • Claim: the check runs after the page imports and covers .stylex, the page's own modules and @astryxdesign/* packages, not default imports: verified (page-worker.mjs:1411-1416, :1474).
  • Claim: type positions, member and property keys and JSX attribute names are skipped: verified for those positions; type-only export specifiers are not skipped.
  • Claim: the browser build's "No matching export" from a page file is reported the same way: verified, though the file is named from the page's folder.
  • Claim: the message names the file and line with no absolute path: verified for every refusal probed.
  • Claim: the maintainers decided that a page a build refuses is refused: no current record states it.
  • Claim: the test covers a relative module, Core's tokens.stylex, a missing Core component, and type-only and default imports: verified; it fails on the base and passes on the head.
  • Claim: no new public API, default or interaction model: verified, no export, option or error code changes.
  • Claim: the command is experimental, and the change is stacked on the live-app change: verified.
  • .changeset/render-missing-named-import.md: misstated base and scope.
  • packages/cli/api/render/render.interactive.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: one-line importedFrom copy; file named from the page's folder.
  • packages/cli/foundation/render/page-worker.mjs: type re-exports refused; ?raw files checked; check skipped when the page import throws.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the check names a missing import or member clearly, but it refuses three kinds of valid page, the release note misstates the base, and the bundle branch still copies shared code.

  • valueUses counts a name in export type {ButtonProps} or export {type ButtonProps} as a value use (page-worker.mjs:1365), so a local module that re-exports an imported type, which the base renders, now fails with "@astryxdesign/core has no export ButtonProps"; treat a type-only export declaration or specifier as a type position and add a test.
  • missingNamedExports walks every file in localFiles (page-worker.mjs:1397), including a file the page imports as ?raw text (:694), so a page that shows a sample whose own import is missing is refused and the sample's modules are loaded; check only files the page loads as modules.
  • The member check reads <Button.Icon /> on the imported Button even where Button is a parameter or local of the same name (page-worker.mjs:1366-1368, :1458), so a page that the base renders and a build accepts is refused; count a use only when the name resolves to the import binding, and add a test.
  • The changeset says such pages "rendered with exit 0 and broke in the browser", but on the base a missing component or member failed with ERR_RENDER_FAILED and other missing names with ERR_RENDER_SCRIPT (only .stylex rendered), and a local name called while the page loads still fails with ERR_RENDER_FAILED; reword the note, and either run the check before classify when the page import throws or narrow the claim to names used while the page renders.
  • client-bundle.mjs:342 reads the module with a one-line copy of importedFrom, so a multi-line import reads "its module has no export nope", and the bundle branch names the file from the page's folder while the server check copies compileSite's project-relative naming; build both messages through importedFrom and one naming helper.

Approval also waits on the governing record: no current record states when astryx experimental render refuses a page, so an engineering owner names or adds the clause that covers refusing a missing name or member, or records the decision by commenting /approve-spec <full head SHA> on this pull request, which the author may do as an engineering owner.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: a page that uses a missing name is refused with ERR_RENDER_COMPILE naming the file, line and module: verified for names used while the page renders, from .stylex, local and Astryx modules, and from other packages through the bundle; false for a local name called while the page loads, which still fails with ERR_RENDER_FAILED.
  • Claim: an element drawn as a member its export lacks is refused the same way: verified; it also refuses a valid page where a parameter shares the imported name.
  • Claim: only names used as values count, so a type imported without type is fine: verified for import specifiers; false for a type re-exported with export type.
  • Claim: before, such a page rendered with exit 0 and broke in the browser: false; only the .stylex case rendered, a missing component or member failed with ERR_RENDER_FAILED, and other missing names with ERR_RENDER_SCRIPT.
  • Claim: before, a missing .stylex value showed the page without that style: verified, the base renders it with exit 0.
  • Claim: StyleX replaces a .stylex import without checking the export, and other missing names surface only in the browser build: the first is verified; the second is partly true, since a missing component or member fails in the server render.
  • Claim: default imports are not checked, and type positions, member and property keys and JSX attribute names are skipped: verified for those positions; type-only export specifiers are not skipped.
  • Claim: the browser build's "No matching export" from a page file is reported the same way: verified, though the file is named from the page's folder and a multi-line import reads "its module".
  • Claim: the message names the file and line with no absolute path: verified for every refusal probed.
  • Claim: the maintainers decided that a page a build refuses is refused: no current record states it.
  • Claim: the test covers a relative module, Core's token module, a missing Core component, a missing member, and type-only and default imports: verified; it fails on the base and passes on the head.
  • Claim: on a frozen set of generated pages, no working page is refused: not rechecked, since that set is not in the repository; the constructed valid pages above are refused.
  • Claim: no new public API, default or interaction model: verified, no export, option or error code changes.
  • Claim: the command is experimental, and the change is stacked on the live-app change: verified.
  • .changeset/render-missing-named-import.md: misstated base and scope.
  • packages/cli/api/render/render.interactive.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: one-line importedFrom copy; file named from the page's folder.
  • packages/cli/foundation/render/page-worker.mjs: type re-exports refused; ?raw files checked; shadowed members refused; check skipped when the page import throws.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Waiting on an engineering owner's decision, with one fix still needed: the check now names a missing import clearly, and the earlier type re-export, ?raw, release-note and shared-message findings are fixed.

  • The member check reads <Button.Icon /> on the imported Button even where Button is a parameter of the same name, as in function Row({Button}) or items.map(({Button}) => …) (page-worker.mjs:1396-1398, :1482-1490), so a page that the base renders and a build accepts is refused; count a use only when the name resolves to the import binding, and add both shapes to the test.

Approval also needs the governing spec: no current record states when astryx experimental render refuses a page, so an engineering owner names or adds the clause that covers refusing a missing named import or member with ERR_RENDER_COMPILE (also when the page's import throws), or records the decision by commenting /approve-spec <full head SHA> on this pull request, which the author may do as an engineering owner.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: a page that imports a missing name is refused with ERR_RENDER_COMPILE, naming the file and line: verified for a relative module, Core's token module, a missing Core component, a name called while the page loads, and another package through the script build.
  • Claim: named imports in the page's own modules are checked against those modules, Astryx packages and StyleX variables modules, and members drawn as <Name.Member> against the export: verified; the member check also refuses a valid page where a parameter shares the imported name.
  • Claim: only names used as values count, so a type imported without type is fine: verified for type positions and type-only re-exports; false for a parameter that shadows an import (the finding above).
  • Claim: a file the page reads as text (?raw) is not checked: verified.
  • Claim: the script's build names the file and module the same way, through the same message: verified, a multi-line import included.
  • Claim: before, a missing component or a name called at load failed with ERR_RENDER_FAILED, a script-only name with ERR_RENDER_SCRIPT, and a missing .stylex value rendered without its style: verified on the base.
  • Claim: StyleX replaces a .stylex import without checking the export: verified.
  • Claim: the check runs after the page imports, or first when its import throws: verified.
  • Claim: default imports are not checked; member and property keys and JSX attribute names are skipped: verified.
  • Claim: the message names the file and line as the page writes them, with no absolute path: verified.
  • Claim: the maintainers decided that a page a build refuses is refused: no current record states it.
  • Claim: the tests cover the listed cases: verified; they pass on the head.
  • Claim: on a frozen set of generated pages no working page is refused: not rechecked, since that set is not in the repository.
  • Claim: no new public API, default or interaction model: verified.
  • Claim: the command is experimental, and the change is stacked on the live-app change: verified.
  • .changeset/render-missing-named-import.md: clear; its value-use sentence holds once the finding is fixed.
  • packages/cli/api/render/render.interactive.test.mjs: clear; no shadowed-member case.
  • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: clear; the new code argument is never read with a non-default value.
  • packages/cli/foundation/render/page-worker.mjs: shadowed members refused.

Automated review (maintainer link)

@josephfarina
josephfarina changed the base branch from josephfarina/render-interactive to main November 17, 2026 16:34
@josephfarina
josephfarina force-pushed the josephfarina/rl-missing-named-import branch from abee4dc to 04296fd Compare November 17, 2026 16:34
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 16:35
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): astryx experimental render refuses a page whose named import the imported module does not export, the way a build would, with ERR_RENDER_COMPILE naming the page's file and line, the module, and the missing export. Type positions and ?raw samples are exempt. Render's reference states the rule.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 04296fd

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 8dfd3e8

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the engineering owner's decision on this pull request settles the refusal itself, and two fixes remain.

  • The check reads any parameter or local binding named like an import as that import, so a valid page with function Row({Button}) { return <Button.Icon />; }, rows.map(({Button}, i) => <Button.Icon key={i} />) or a local const Card = {Lede: …} is refused with "has no export Button.Icon" (page-worker.mjs:1390-1421, :1489-1497); count a use or member only when the name resolves to the import binding, and add these shapes to the test.
  • The render reference (render.doc.mjs:19) says every missing named import or member is refused with ERR_RENDER_COMPILE, but a missing component from a package the check does not read (anything but the page's own modules, Astryx packages and .stylex modules) still fails with ERR_RENDER_FAILED when the page draws it; name the checked modules in that sentence, as the changeset does, or check every named import.

Non-blocking: BundleError's new code argument is never read with a non-default value (page-worker.mjs:1629), so dropping it leaves one path.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: Before: a missing Core component failed with ERR_RENDER_FAILED and React's "Element type is invalid", and so did a missing function called at load: verified on the base (the load case's message is "… is not a function").
  • Claim: Before: a missing name used only in the script failed with ERR_RENDER_SCRIPT: verified on the base.
  • Claim: Before: a missing .stylex name rendered with exit 0 and no style, because StyleX does not check the export: verified on the base.
  • Claim: Now refused with ERR_RENDER_COMPILE naming the file, line, module and name: verified for a local module, Core's token module, a missing Core component, a name called at load and a script-only package import.
  • Claim: Named imports from .stylex modules, the page's own modules and @astryxdesign/* packages are checked, after the page imports or first when its import throws: verified.
  • Claim: A file read as text (?raw) is not checked: verified.
  • Claim: Only names used as values count (type positions, type-only exports, keys and attribute names skipped), and default imports are not checked: verified for those constructs; false for a name a parameter or local binding shadows (first finding).
  • Claim: A <Name.Member> whose export lacks the member is refused: verified; shadowed members are refused too (first finding).
  • Claim: The browser build's missing-export error in a page file is reported the same way, with the file named from the project: verified, a multi-line import included.
  • Claim: Messages name the file and line with no absolute path: verified.
  • Claim: The command is experimental: verified.
  • Claim: The maintainers decided that a page a build refuses is refused: verified, an engineering owner recorded the decision on this pull request for this head.
  • Claim: The listed tests cover these cases and pass: verified on this head.
  • Claim: Figures from a set of 3,935 generated pages: not checkable, the set is not in the repository.
  • Claim: No new public API, visual representation, default or interaction model: verified.
  • Claim: Changeset: refuses a page importing a missing name, as a build does, with ERR_RENDER_COMPILE and the example message: verified for the checked module kinds.
  • Claim: Changeset: checks the page's own modules, Astryx packages, .stylex modules and <Name.Member>: verified.
  • Claim: Changeset: counts only names used as values, so a type imported without type is fine: verified for types; false for shadowed names (first finding).
  • Claim: Changeset: ?raw files are not checked, and the script's build names the file and module the same way: verified.
  • Claim: Changeset: the base's codes per case (ERR_RENDER_FAILED, ERR_RENDER_SCRIPT, exit 0 for .stylex): verified; the quoted React message fits the missing-component case only.
  • .changeset/render-missing-named-import.md: the value-use sentence is false for shadowed names (first finding); otherwise clear.
  • packages/cli/api/render/render.doc.mjs: the refusal sentence overstates what is checked (second finding).
  • packages/cli/api/render/render.interactive.test.mjs: clear; it has no shadowing case.
  • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: clear; the new code argument is unused (non-blocking).
  • packages/cli/foundation/render/page-worker.mjs: shadowed names are read as the import (first finding).

Automated review (maintainer link)

Comment thread packages/cli/api/render/render.doc.mjs Resolved
@josephfarina
josephfarina marked this pull request as draft November 17, 2026 17:06
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 17:07
@josephfarina
josephfarina force-pushed the josephfarina/rl-missing-named-import branch from 04296fd to 4f3c04d Compare November 17, 2026 17:42
@josephfarina
josephfarina changed the base branch from main to josephfarina/rl-missing-packages November 17, 2026 17:42
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4f3c04d

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet, because its run stopped when CI was full; rerun it before merging.

The engineering owner's decision settles the refusal itself, and the earlier blocking findings are fixed: shadowed names resolve to their own bindings, type-only re-exports and ?raw files are skipped, and the render reference names the modules it checks.

Non-blocking, worth a follow-up:

  • The render reference (render.doc.mjs) and the changeset do not mention that a package subpath the package does not export is now refused with ERR_RENDER_COMPILE for any package, and "imports from other packages are not checked" reads as if no other-package import gets that code, while the script build gives it for a missing name a handler uses.
  • The changeset's "Element type is invalid" parenthetical fits the missing-component case only; the load-time case said "… is not a function".
  • The description's smallest-restoration list is stale: the worker holds the whole check, and the bundle error carries the import's file, line and name rather than a code.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: Before: a missing Core component failed with ERR_RENDER_FAILED and React's "Element type is invalid": verified on the base.
  • Claim: Before: a missing function called while the page loads failed with ERR_RENDER_FAILED: verified; its message was "… is not a function".
  • Claim: Before: a missing name used only in the page's script failed with ERR_RENDER_SCRIPT: verified on the base.
  • Claim: Before: a missing .stylex name rendered with exit 0 and no style, because StyleX does not check the export: verified on the base.
  • Claim: Now refused with ERR_RENDER_COMPILE and a message naming the file, line, module and name: verified.
  • Claim: Named imports from .stylex modules, the page's own modules and @astryxdesign/* packages are checked, after the page imports or first when its import throws: verified.
  • Claim: A file read as text (?raw) is not checked: verified.
  • Claim: Only names used as values count (type positions, type-only exports, keys and attribute names skipped), and default imports are not checked: verified, shadowing parameters and locals included.
  • Claim: A <Name.Member> whose export has no such member is refused: verified.
  • Claim: The browser build's missing-export error in a page file is reported the same way, naming the file from the project: verified, a multi-line import included.
  • Claim: Messages name the file and line with no absolute path: verified.
  • Claim: The command is experimental: verified.
  • Claim: The maintainers decided that a page a build refuses is refused: verified, an engineering owner recorded the decision and approved this head.
  • Claim: The smallest-restoration list: stale wording; the worker holds the whole check and the bundle error carries the import's file, line and name (non-blocking).
  • Claim: The listed tests cover these cases and pass, as does the testing command: verified on this head.
  • Claim: Figures from a set of 3,935 generated pages: not checkable, the set is not in the repository.
  • Claim: No new public API, visual representation, default or interaction model: verified.
  • Claim: Separable tagalongs removed or split: the subpath refusal stays; it is related and approved but not described (non-blocking).
  • Claim: Public text contains no internal context: verified.
  • Claim: Changeset: refuses a page importing a missing name, as a build does, with ERR_RENDER_COMPILE and the example message: verified.
  • Claim: Changeset: checks the page's own modules, Astryx packages, .stylex modules and <Name.Member>: verified.
  • Claim: Changeset: counts only value uses, so a type imported without type is fine, and ?raw files are not checked: verified.
  • Claim: Changeset: the script's build names the file and module the same way: verified.
  • Claim: Changeset: the base's codes per case: verified; the "Element type is invalid" parenthetical fits only the missing-component case (non-blocking).
  • .changeset/render-missing-named-import.md: clear apart from the parenthetical and the missing subpath sentence (non-blocking).
  • packages/cli/api/render/render.doc.mjs: clear; the last clause could name the script-build and subpath refusals (non-blocking).
  • packages/cli/api/render/render.interactive.test.mjs: clear.
  • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: clear.
  • packages/cli/foundation/render/page-worker.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/render/render.doc.mjs Resolved
@josephfarina
josephfarina force-pushed the josephfarina/rl-missing-named-import branch from 4f3c04d to 702a358 Compare November 17, 2026 19:24

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the engineering owner's decision and /approve-spec for this head settle the refusal itself, but three statements about it are false at this head.

  • Miss: the changeset and the description say that a missing function the page calls while it loads failed with "Element type is invalid", but on the base it failed with ERR_RENDER_FAILED "… is not a function", so give each case its own message.
  • Miss: the render reference (render.doc.mjs) says that default imports and imports from other packages are not checked, but this head refuses an import of a subpath that any package does not export, default and side-effect imports included, and the script build refuses a missing name from another package, so state both there as the changeset does for the subpath.
  • Miss: the description's "Smallest restoration" list says that the bundle error carries its own code, but BundleError carries the missing import's file, line, names and module, and the worker holds the whole named-import, member and subpath check, not only the .stylex check.

The first two fixes need a commit, and the new head then needs its own /approve-spec. Non-blocking: a local module that re-exports a type with a plain export {ButtonProps} now makes the render refuse the page, although esbuild accepts that line, and export type avoids the refusal. CI's test jobs did not run on this head because CI was full.

Claims and files checked

Review mode: full; reason: rebase

  • Changeset: refuses a page that imports a name its module does not export, as a build does, with ERR_RENDER_COMPILE and the example message: verified (new test, probe).
  • Changeset: checks the page's own modules, Astryx packages, .stylex modules and <Name.Member>: verified.
  • Changeset: counts only value uses, so a type imported without type renders, and ?raw files are not checked: verified; a plain type re-export counts as a value use (non-blocking).
  • Changeset: the script build names the file and the module the same way: verified.
  • Changeset: a package subpath that the package does not export is refused the same way: verified.
  • Changeset: before, ERR_RENDER_FAILED with "Element type is invalid" for a missing component or a missing name called at load: false for the load-time message.
  • Changeset: before, ERR_RENDER_SCRIPT for a name only the script uses, and a missing .stylex value rendered without its style: verified on the base.
  • Description: before, a missing Core component failed with ERR_RENDER_FAILED and "Element type is invalid": verified on the base.
  • Description: a missing function called while the page loads failed the same way: false for the message.
  • Description: before, a script-only name gave ERR_RENDER_SCRIPT, and a missing .stylex name rendered with exit 0: verified on the base.
  • Description: now refused with ERR_RENDER_COMPILE, naming the file, line, module and name, with no absolute path: verified.
  • Description: the check runs after the page imports, or first when the import throws: verified.
  • Description: ?raw files are not checked; only value uses count; default imports are not checked: verified.
  • Description: a <Name.Member> that the export lacks is refused: verified.
  • Description: the browser build's missing-export error is reported the same way, naming the file from the project: verified.
  • Description: the command is experimental, and the maintainers decided the refusal: verified, including an engineering owner's approval of this head.
  • Description: the smallest-restoration list: false (the bundle error carries no code; the worker holds the whole check).
  • Description: the listed tests cover the cases and the testing command passes: verified at this head.
  • Description: the figures from a set of 3,935 generated pages: not checkable, because the set is not in the repository.
  • Description: scope checklist (one change, tagalongs settled, no new public API, no internal context): verified; the subpath refusal is related and approved.
  • .changeset/render-missing-named-import.md: finding (the load-time message).
  • packages/cli/api/render/render.doc.mjs: finding (the scope sentence).
  • packages/cli/api/render/render.interactive.test.mjs: clear.
  • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: clear.
  • packages/cli/foundation/render/page-worker.mjs: non-blocking note (plain type re-export).

Automated review (maintainer link)

Comment thread packages/cli/api/render/render.doc.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9db4edf

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the engineering owner's decision and /approve-spec for this head settle the refusal, and this push fixes the release note, the description and the plain type re-export, but the reference's new rule sentence overstates what is refused.

  • The render reference (render.doc.mjs) says a missing name from another package is refused with ERR_RENDER_COMPILE and lists only type and default imports as unchecked, but a page that draws or calls a missing name from another package as it renders, or draws a name a local module only re-exports with a plain export {…}, still fails with ERR_RENDER_FAILED, so say that another package's missing name is refused only when the page's script is built and add the plain re-export to the unchecked list.

The fix needs a commit, and the new head then needs its own /approve-spec. Non-blocking: the plain re-export skip also applies to JavaScript modules, where export {X} can only be a value and the script build refuses a missing one, so limiting the skip to TypeScript modules keeps that case refused. CI's test jobs did not run on this head because CI was full.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Changeset: refuses a page that imports a name its module does not export, as a build does, with ERR_RENDER_COMPILE and the example message: verified (new test).
  • Changeset: checks the page's own modules, Astryx packages, .stylex modules and <Name.Member>: verified (new test).
  • Changeset: counts only value uses, so a type imported without type renders, and ?raw files are not checked: verified (new test).
  • Changeset: the script build names the file and module the same way: verified (new test, probe).
  • Changeset: an import of a package subpath the package does not export is refused the same way: verified (new test; probe of default and side-effect imports).
  • Changeset: before, ERR_RENDER_FAILED "Element type is invalid" for a missing component, "… is not a function" for a missing function called at load, ERR_RENDER_SCRIPT for a script-only name, and a missing .stylex value rendered without its style: verified (probe on the base).
  • Changeset: an [experimental] patch entry that names the command: verified.
  • Description: before, a missing Core component and a missing load-time function failed with ERR_RENDER_FAILED and their own messages; an unexported subpath failed with Node's error and an absolute path; a script-only name gave ERR_RENDER_SCRIPT; a missing .stylex name rendered: verified (probe on the base).
  • Description: now refused with ERR_RENDER_COMPILE naming the file, line, module and name, with no absolute path: verified (new test).
  • Description: the check runs after the page imports, or first when the import throws: verified (page-worker.mjs:1629-1642).
  • Description: ?raw files are not checked; only value uses through the import binding count; types, export type, export {type …} and a plain re-export do not; default imports are not checked: verified (new test, page-worker.mjs:1569-1573).
  • Description: a <Name.Member> that the export lacks is refused: verified (new test).
  • Description: the browser build's missing-export error is reported the same way, naming the file from the project: verified (new test).
  • Description: an unexported package subpath is refused on the server, in StyleX's compile and in the browser build: verified for the server and StyleX's compile (new test, probe); the browser-build branch read.
  • Description: the browser build refuses a missing named import from any other package: verified (probe, a name used only in a handler).
  • Description: the command is experimental, and the maintainers decided the refusal: verified, including an engineering owner's approval of this head.
  • Description: the smallest-restoration list: verified.
  • Description: the listed tests cover the cases and the testing command passes: verified at this head.
  • Description: the figures from a frozen set of generated pages: not checkable, because the set is not in the repository.
  • Description: scope checklist (one change, tagalongs settled, no new public API, no internal context): verified.
  • .changeset/render-missing-named-import.md: clear.
  • packages/cli/api/render/render.doc.mjs: finding (the rule sentence).
  • packages/cli/api/render/render.interactive.test.mjs: clear.
  • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • packages/cli/foundation/render/client-bundle.mjs: clear.
  • packages/cli/foundation/render/page-worker.mjs: non-blocking note (plain re-export skip in JavaScript modules).

Automated review (maintainer link)

Comment thread packages/cli/api/render/render.doc.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c2d7ad9

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet, and no blocking findings remain.

Next: rebase onto main, keeping both edits to the description string in packages/cli/api/render/render.doc.mjs; the rebased head needs its own review and /approve-spec.

  • Miss (non-blocking): the reference at render.doc.mjs:19 should list "a name the page never uses as a value" under "Not checked", since a JavaScript page with such an import renders though esbuild refuses it.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none
  • Claims (changeset):
    • Refuses a page that imports a name its module does not export, with ERR_RENDER_COMPILE naming the file and line: verified (page-worker.mjs:1221-1229, new test)
    • Checks named imports in the page's own modules from those modules, Astryx packages and .stylex modules: verified (page-worker.mjs:1566-1568)
    • Refuses a <Name.Member> whose export lacks the member: verified (page-worker.mjs:1598-1610, new test)
    • Counts only value uses, so a type imported without type is fine: verified (value-use reading, new test)
    • Skips files the page reads as text (?raw): verified (page-worker.mjs:1554-1555, new test)
    • The script build names the file and module the same way: verified (client-bundle.mjs:480-503, page-worker.mjs:1745-1746, new test)
    • Refuses an unexported package subpath as "has no export ./Chart": verified (page-worker.mjs:1315-1322, new test)
    • Before: "Element type is invalid", "… is not a function", ERR_RENDER_SCRIPT, and a .stylex page rendered with no error: verified on the base
  • Claims (description):
    • Before, an unexported subpath failed with Node's error naming the installed absolute path: verified on the base
    • Checks after the page imports, or first when the import throws: verified (page-worker.mjs:1636-1647, new test)
    • Parameters and local bindings named like an import do not count: verified (new test)
    • Default imports from a module that exists are not checked: verified (page-worker.mjs:1578)
    • The bundle's "No matching export" uses the same message, naming the file from the project root: verified (new test)
    • The subpath refusal works on the server, in the StyleX compile and in the browser build: verified (page-worker.mjs:1353-1358, client-bundle.mjs:493-503, new test)
    • Another package's missing name is refused only when the script is built; drawn or called at render, it fails with ERR_RENDER_FAILED: verified
    • A plain re-export does not count in TypeScript and counts in JavaScript: verified (page-worker.mjs:1572-1577, new test)
    • Messages carry no absolute path: verified (new test)
    • An engineering owner decided this refusal: verified (owner decision and exact-head approval on this pull request)
    • No page from the frozen generated set is newly refused: unverified (the set is not in the repository); every page template still renders in the suite
    • The listed tests pass: verified (render and doc-loads suites pass)
    • No new public API: verified
  • Files:
    • .changeset/render-missing-named-import.md: clear
    • packages/cli/api/render/render.doc.mjs: non-blocking wording note above
    • packages/cli/api/render/render.interactive.test.mjs: clear
    • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear
    • packages/cli/foundation/render/client-bundle.mjs: clear
    • packages/cli/foundation/render/page-worker.mjs: clear

Automated review (maintainer link)

Comment thread packages/cli/api/render/render.doc.mjs Resolved
@josephfarina
josephfarina force-pushed the josephfarina/rl-missing-named-import branch from c2d7ad9 to b58a0ac Compare November 17, 2026 21:14
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b58a0ac

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet, because its run stopped when CI was full; re-run it before merging. No blocking findings remain, and the rebase keeps both edits to the render reference.

  • Non-blocking: the reference at render.doc.mjs:19 should list "a name the page never uses as a value" under "Not checked", and its parenthetical should say "as it renders", since a page that calls such a name only in a click handler renders.
  • Miss (non-blocking): a missing name from a local CommonJS module (module.exports = {a: 1}) is now refused although esbuild builds that page; skip CommonJS modules in the check or name the case in the reference.
Claims and files checked

Review mode: full; reason: rebase

  • Claims (release note):
    • Refuses a page that imports a name its module does not export, with a compile error naming the file and line: verified (page-worker.mjs:1221-1229, new test, probes)
    • Checks named imports in the page's own modules from those modules, Astryx packages and .stylex modules: verified (page-worker.mjs:1563-1568)
    • Refuses a <Name.Member> whose export lacks the member: verified (page-worker.mjs:1598-1610, new test)
    • Counts only names used as values, so a type imported without type is fine: verified (value-uses.mjs:56-81, page-worker.mjs:1578, new test)
    • Skips files the page reads as text (?raw): verified (page-worker.mjs:1078, :1555, new test)
    • The script build names the file and module the same way: verified (client-bundle.mjs:480-490, page-worker.mjs:1745-1746, new test)
    • Refuses an unexported package subpath as "has no export ./Chart": verified (page-worker.mjs:1315-1322, new test)
    • Before: "Element type is invalid", "… is not a function", the script-build error, and a .stylex page rendered with no error: verified on the base
    • "As a build refuses it": holds except for a local CommonJS module, which is refused though esbuild builds it (non-blocking note above)
  • Claims (description):
    • Before, an unexported subpath failed with Node's error naming the installed absolute path: verified on the base
    • Checks after the page imports, or first when the import throws: verified (page-worker.mjs:1634-1647)
    • Parameters and local bindings named like an import do not count: verified (value-uses.mjs:66-72, new test)
    • Type re-exports and a TypeScript plain re-export do not count; in JavaScript a plain re-export counts: verified (value-uses.mjs:32-36, page-worker.mjs:1572-1577, new test)
    • Default imports from a module that exists are not checked: verified (page-worker.mjs:1578)
    • The bundle's "No matching export" uses the same message, naming the file from the project root: verified (page-worker.mjs:1209-1214, new test)
    • The subpath refusal covers named, default and side-effect imports on the server, in the StyleX compile and in the browser build: verified (page-worker.mjs:1258-1281, :1353-1358, client-bundle.mjs:491-503, new test)
    • Another package's missing name is refused only when the script is built; drawn as the page renders, it fails as before: verified (probes)
    • Messages carry no absolute path: verified (new test, probes)
    • The value-use reading is shared with the missing-package check: verified (page-worker.mjs:1480)
    • An engineering owner decided this refusal: verified (decision and approval for this head on the pull request)
    • No page from the frozen generated set is newly refused: unverified (the set is not in the repository); every page template still renders in the suite
    • The listed tests pass: verified (render suite on this head)
    • No new public API: verified
  • Files:
    • .changeset/render-missing-named-import.md: clear
    • packages/cli/api/render/render.doc.mjs: non-blocking wording notes above
    • packages/cli/api/render/render.interactive.test.mjs: clear
    • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear
    • packages/cli/foundation/render/client-bundle.mjs: clear
    • packages/cli/foundation/render/page-worker.mjs: non-blocking CommonJS note above

Automated review (maintainer link)

Comment thread packages/cli/api/render/render.doc.mjs Resolved
…stryx package that does not exist is refused
…ue uses; a name called at load is named; one message for both checks
…ding (Babel scope, shared with the missing-package check); the docs name the checked modules
…is refused as ERR_RENDER_COMPILE, naming the page's file and line
…each old failure as it is; a plain re-export is no use
…ame is refused only in the script build, and names the plain re-export case; the re-export skip is TypeScript-only
…onJS modules is not checked, as a bundler reads it by interop; the reference lists unused names as unchecked
@josephfarina
josephfarina force-pushed the josephfarina/rl-missing-named-import branch from b58a0ac to 8dfd3e8 Compare November 17, 2026 23:02
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8dfd3e8

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: the CI workflow has not finished on this head yet, so this is not ready to merge until it passes. No blocking findings remain; the render reference now lists every case the check leaves alone, and a missing name from a local CommonJS module renders again, as a bundler builds it.

Claims and files checked

Review mode: full; reason: rebase

  • Claims (release note):
    • Refuses a page importing a name its module does not export, with a compile error naming the file and line: verified (page-worker.mjs:1254-1262, :1606-1668, new test, probes)
    • Checks the page's own modules (not CommonJS ones), Astryx packages and .stylex modules: verified (page-worker.mjs:1620-1622, probes)
    • Refuses a <Name.Member> whose export lacks the member: verified (page-worker.mjs:1652-1664, new test)
    • Counts only value uses, so a type imported without type is fine, and a file read as text is not checked: verified (value-uses.mjs:20-81, page-worker.mjs:1608, new test)
    • The script build names the file and module the same way: verified (client-bundle.mjs:510-521, page-worker.mjs:1799-1800, probe)
    • An unexported package subpath is refused as "has no export ./Chart": verified (page-worker.mjs:1291-1355, probes)
    • Before: "Element type is invalid", "… is not a function", a script-build error, and a .stylex page rendered with no error: verified on the base (probes)
  • Claims (description):
    • Before, an unexported subpath failed with a message naming the installed package's absolute path: verified on the base (probes)
    • Checks after the page imports, or first when the import throws: verified (page-worker.mjs:1688-1701)
    • Parameters and local bindings named like an import do not count: verified (value-uses.mjs:66-72, new test)
    • Type re-exports and a TypeScript plain re-export do not count; in JavaScript a plain re-export counts: verified (value-uses.mjs:32-36, page-worker.mjs:1626-1631, new test)
    • Default imports from an existing module and named imports from a local CommonJS module are not checked: verified (page-worker.mjs:1584-1593, :1622, :1632, new test, probes)
    • The bundle's "No matching export" uses the same message, naming the file from the project root: verified (page-worker.mjs:1242-1262, new test)
    • The subpath refusal covers named, default and side-effect imports on the server, in the StyleX compile and in the browser build: verified (page-worker.mjs:1291-1355, :1386-1391, client-bundle.mjs:522-534, new test, probes)
    • Another package's missing name is refused only when the script is built; drawn as the page renders, it fails as before: verified (probes)
    • Messages carry no absolute path: verified (new test, probes)
    • The value-use reading is shared with the missing-package check: verified (page-worker.mjs:1513, :1616)
    • An engineering owner decided this refusal: verified (decision and approval for this head on the pull request)
    • No page from the frozen generated set is newly refused: unverified (the set is not in the repository); every page template still renders in the suite
    • The listed tests pass: verified (render suite on this head)
    • No new public API: verified
  • Files:
    • .changeset/render-missing-named-import.md: clear
    • packages/cli/api/render/render.doc.mjs: clear
    • packages/cli/api/render/render.interactive.test.mjs: clear
    • packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear
    • packages/cli/foundation/render/client-bundle.mjs: clear
    • packages/cli/foundation/render/page-worker.mjs: clear

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 02f5df1 into main Nov 18, 2026
80 checks passed
@github-actions
github-actions Bot deleted the josephfarina/rl-missing-named-import branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 8dfd3e86 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant