You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A type imported from a JS module (declared export type in its .d.rx, or a package's TS-only type) compiles to a value import; the bundle fails with MISSING_EXPORT #78
A Vite (Rolldown) build then fails with MISSING_EXPORT for both names: neither lib.ts nor @stylexjs/stylex exports them as values.
Expected
guide/reference.md says there is no import type and types are imported the same way, and MO-6c says an imported type "binds no value". So:
Outcome is declared export type in the .d.rx beside the module (MO-8a). The compiler knows it is a type and should emit neither the ES import nor the binding.
StyleXStyles has no .d.rx, so only its use tells the compiler it is a type. A name an import binds that is only read in type positions should be erased too. Otherwise a type from a package cannot be imported at all; the only workaround is an inline import("@stylexjs/stylex").StyleXStyles type.
Cause
.rx imports already skip types: compiler/src/emit.rs:606 checks Decl::TypeDecl / ExportSig::Type and continues ("a type binds nothing"). JS imports (resolved: None) have no such check, even when the .d.rx declares the name as JsDecl::Type:
compiler/src/emit.rs:361 builds the module-level import { … } from every name;
compiler/src/emit.rs:676-696 binds every name to w$<alias> and emits __rt.reg.
Both should drop a name the declaration file declares as a type, and ideally a name that is used only in type positions.
Activity