Skip to content

Commit 4c3270c

Browse files
committed
fix(deps): require use-sync-external-store ^1.5.0 so the ESM build loads 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), and add a build job step that loads the built package with Node as both ESM and CJS so this can't regress unnoticed.
1 parent 711828c commit 4c3270c

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎.github/workflows/test.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
- name: Build
3838
id: pack-dir
3939
run: ./build.sh
40+
# Load the built package with Node's own module resolution (not a bundler's), the way
41+
# Vitest, SSR, and plain Node consumers do. Catches imports that only bundlers can resolve.
42+
- name: Check that the built package loads in Node
43+
run: |
44+
node --input-type=module -e "await import('reactfire')"
45+
node -e "require('reactfire')"
4046
- name: 'Upload Artifact'
4147
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4248
with:

‎package-lock.json‎

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"dependencies": {
110110
"rxfire": "^6.1.0",
111111
"rxjs": "^6.6.3 || ^7.0.1",
112-
"use-sync-external-store": "^1.2.0"
112+
"use-sync-external-store": "^1.5.0"
113113
},
114114
"allowScripts": {
115115
"@firebase/util@1.12.1": true,

0 commit comments

Comments
 (0)