Repository navigation
Conversation
…ads in Node dist/index.js imports `use-sync-external-store/shim`, which is kept external. Before 1.5.0 the package had no `exports` map, so Node's ESM resolver treats `/shim` as a directory and throws ERR_UNSUPPORTED_DIR_IMPORT. That breaks anything that loads the ESM build without a bundler: Vitest tests in apps that use reactfire, SSR that keeps dependencies external, and plain Node scripts. The CJS build is fine. Raise the floor to ^1.5.0 (lockfile: 1.2.0 -> 1.7.0).
jhuleatt
force-pushed
the
fix/use-sync-external-store-esm
branch
from
October 28, 2026 14:47
4c3270c to
4463c3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dist/index.jsimportsuse-sync-external-store/shim. The import stays external on purpose: inlining the shim broke Next.js, seevite.config.ts. Versions ofuse-sync-external-storebefore 1.5.0 have noexportsmap, so Node's ESM resolver treats/shimas a directory and won't load it:Bundlers resolve directory imports, so browser builds are fine. It breaks anything that loads reactfire's ESM build with Node's own resolver, for example:
node_modulespackages with Node directly, so the whole test file fails to load.The CJS build (
require('reactfire')) isn't affected.reactfire declares
^1.2.0, so fresh installs usually get a newer version. But any project that ends up with an older copy (from an existing lockfile, or another package that pins it) is broken. This repo's own lockfile still had 1.2.0.Changes
use-sync-external-storeto^1.5.0, the first version with anexportsmap (./shim→./shim/index.js). The lockfile now resolves 1.7.0. 1.5.0+ also lists React 19 in its peer range; 1.2.0 stopped at React 18.Testing
A consumer project that pins
use-sync-external-store, importing the packed tarball:use-sync-external-storeinstalledmain(^1.2.0)ERR_UNSUPPORTED_DIR_IMPORT^1.5.0)^1.5.0)Also:
import('reactfire')fails onmain. With this change it loads all 74 exports on both Node 22 and 24.tsc(src and tests) and the full emulator test suite pass. So does the React 19 type-check setup.