Summary
@effector/reflect@10.1.0 is published without the exports field in its package.json. Version 10.0.2 had it.
Root cause
build.mjs, which generates dist/package.json, uses a typo — export: Existing.export (singular, non-existent) instead of exports: Existing.exports:
const Dist = {
...
export: Existing.export, // ← typo; Existing.export is undefined
...
};
Introduced in commit cef40e6 ("ci: include over exclude fields for dist/package.json"). The source package.json still has a correct exports, but it never reaches the built artifact.
Impact
- The
@effector/reflect/scope subpath no longer resolves via exports.
- Bundlers fall back to
main (CJS). The CJS entry requires its own copy of effector-react, producing a dual-package hazard: <Provider> (ESM) and the useUnit used inside variant/reflect (CJS) end up referencing different effector-react instances. The forked scope is then lost — variant/reflect read the store's default value instead of the scoped one.
Reproduction
React 19 app, bundler resolving the package entry (Vite/Vitest):
const Cmp = variant({ if: $flag, then: Then, else: Else });
render(
<Provider value={fork({ values: [[$flag, false]] })}>
<Cmp />
</Provider>,
);
// expected: <Else/>; actual on 10.1.0: <Then/> (reads default `true`, not scoped `false`)
Pinning back to 10.0.2 (which still ships exports) fixes it.
Fix
build.mjs: export → exports. PR incoming. Also adding a guard in validate_dist.mjs so a missing exports fails dist validation (the current attw/publint calls swallow their errors).
Summary
@effector/reflect@10.1.0is published without theexportsfield in itspackage.json. Version10.0.2had it.Root cause
build.mjs, which generatesdist/package.json, uses a typo —export: Existing.export(singular, non-existent) instead ofexports: Existing.exports:Introduced in commit
cef40e6("ci: include over exclude fields for dist/package.json"). The sourcepackage.jsonstill has a correctexports, but it never reaches the built artifact.Impact
@effector/reflect/scopesubpath no longer resolves viaexports.main(CJS). The CJS entryrequires its own copy ofeffector-react, producing a dual-package hazard:<Provider>(ESM) and theuseUnitused insidevariant/reflect(CJS) end up referencing different effector-react instances. The forked scope is then lost —variant/reflectread the store's default value instead of the scoped one.Reproduction
React 19 app, bundler resolving the package entry (Vite/Vitest):
Pinning back to
10.0.2(which still shipsexports) fixes it.Fix
build.mjs:export→exports. PR incoming. Also adding a guard invalidate_dist.mjsso a missingexportsfails dist validation (the currentattw/publintcalls swallow their errors).