fix(react-native-tracker): emit .d.ts with .js extensions for nodenext#1478
Merged
Matus Tomlein (matus-tomlein) merged 3 commits intoJun 17, 2026
Merged
Conversation
…odenext Upgrade react-native-builder-bob from 0.30.3 to 0.42.1 so the emitted TypeScript declaration files include explicit .js extensions on relative import/export specifiers (e.g. export * from './types.js'). Previously the ESM .js output carried extensions (added by bob's Babel pipeline) but the .d.ts files came straight from tsc and were extensionless, breaking type resolution for consumers using TypeScript's moduleResolution: 'nodenext' / 'node16'. bob 0.42.0 added this rewriting via callstack/react-native-builder-bob#945, including handling for React Native platform-specific declarations (.ios.d.ts / .android.d.ts) and .mts/.cts. The bob 0.42 typescript target no longer accepts an `esm` option (it is inferred from the commonjs/module targets), so it is removed from the build config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot started reviewing on behalf of
Matus Tomlein (matus-tomlein)
June 12, 2026 11:38
View session
There was a problem hiding this comment.
Pull request overview
This PR addresses TypeScript moduleResolution: "nodenext"/"node16" consumer breakage in @snowplow/react-native-tracker by ensuring emitted .d.ts files include .js extensions in internal re-exports/imports (matching the existing ESM JS output behavior).
Changes:
- Upgrades
react-native-builder-bobto a version that rewrites internal.d.tspaths to include.jsextensions for NodeNext/Node16 resolution. - Updates the bob
typescripttarget configuration by removing the no-longer-supportedesmoption. - Updates Rush repo state to reflect the lockfile change.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| trackers/react-native-tracker/package.json | Bumps bob to ^0.42.1 and adjusts bob build target config for TypeScript declarations. |
| common/config/rush/repo-state.json | Updates Rush shrinkwrap hash after dependency/lockfile changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
72
to
76
| "@types/react": "^18.2.44", | ||
| "react-native": "0.74.5", | ||
| "node-fetch": "~3.3.2", | ||
| "react-native-builder-bob": "^0.30.3", | ||
| "react-native-builder-bob": "^0.42.1", | ||
| "react-native-get-random-values": "^1.11.0" |
…s fix Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
react-native-builder-bob 0.42.1 and its transitive dependencies (e.g. yargs-parser@22) require Node >= 20, which broke CI on Node 18. Node 18 is also EOL. Bump CI workflows and .nvmrc to Node 22 (active LTS) and raise rush.json nodeSupportedVersionRange floor to 20.19.0 (bob's minimum). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Jack Keene (Jack-Keene)
approved these changes
Jun 17, 2026
Merged
Matus Tomlein (matus-tomlein)
added a commit
that referenced
this pull request
Jun 17, 2026
#1478) * fix(react-native-tracker): emit .d.ts files with .js extensions for nodenext Upgrade react-native-builder-bob from 0.30.3 to 0.42.1 so the emitted TypeScript declaration files include explicit .js extensions on relative import/export specifiers (e.g. export * from './types.js'). Previously the ESM .js output carried extensions (added by bob's Babel pipeline) but the .d.ts files came straight from tsc and were extensionless, breaking type resolution for consumers using TypeScript's moduleResolution: 'nodenext' / 'node16'. bob 0.42.0 added this rewriting via callstack/react-native-builder-bob#945, including handling for React Native platform-specific declarations (.ios.d.ts / .android.d.ts) and .mts/.cts. The bob 0.42 typescript target no longer accepts an `esm` option (it is inferred from the commonjs/module targets), so it is removed from the build config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(react-native-tracker): add rush change file for .d.ts extensions fix Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: bump Node from 18 to 22 react-native-builder-bob 0.42.1 and its transitive dependencies (e.g. yargs-parser@22) require Node >= 20, which broke CI on Node 18. Node 18 is also EOL. Bump CI workflows and .nvmrc to Node 22 (active LTS) and raise rush.json nodeSupportedVersionRange floor to 20.19.0 (bob's minimum). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Matus Tomlein (matus-tomlein)
added a commit
that referenced
this pull request
Jun 17, 2026
#1478) * fix(react-native-tracker): emit .d.ts files with .js extensions for nodenext Upgrade react-native-builder-bob from 0.30.3 to 0.42.1 so the emitted TypeScript declaration files include explicit .js extensions on relative import/export specifiers (e.g. export * from './types.js'). Previously the ESM .js output carried extensions (added by bob's Babel pipeline) but the .d.ts files came straight from tsc and were extensionless, breaking type resolution for consumers using TypeScript's moduleResolution: 'nodenext' / 'node16'. bob 0.42.0 added this rewriting via callstack/react-native-builder-bob#945, including handling for React Native platform-specific declarations (.ios.d.ts / .android.d.ts) and .mts/.cts. The bob 0.42 typescript target no longer accepts an `esm` option (it is inferred from the commonjs/module targets), so it is removed from the build config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(react-native-tracker): add rush change file for .d.ts extensions fix Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: bump Node from 18 to 22 react-native-builder-bob 0.42.1 and its transitive dependencies (e.g. yargs-parser@22) require Node >= 20, which broke CI on Node 18. Node 18 is also EOL. Bump CI workflows and .nvmrc to Node 22 (active LTS) and raise rush.json nodeSupportedVersionRange floor to 20.19.0 (bob's minimum). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
A customer reported that
@snowplow/react-native-tracker.d.tsdeclaration files do not include file extensions on internal import/export paths (e.g.export * from './types'instead ofexport * from './types.js'). This breaks type resolution for consumers using TypeScript'smoduleResolution: 'nodenext'/'node16'.The ESM JS output was already correct (
export * from "./types.js") — extensions are added byreact-native-builder-bob's Babel pipeline — but the declaration files came straight fromtscwithmoduleResolution: nodeand were extensionless. Undernodenext, this surfaces aserror TS2305: Module '...' has no exported member 'TrackerConfiguration'because the internal re-exports fail to resolve.Fix
Upgrade
react-native-builder-bob0.30.3→0.42.1. bob0.42.0added.d.tsextension rewriting (callstack/react-native-builder-bob#945), including RN-aware handling of platform-specific declarations (.ios.d.ts/.android.d.ts) and.mts/.cts— edge cases a hand-rolled post-processing script would get wrong.The bob 0.42
typescripttarget no longer accepts anesmoption (it is inferred from thecommonjs/moduletargets), so it is removed from the build config inpackage.json.Verification
rushx buildsucceeds; emitteddist/typescript/module/src/*.d.ts(the ESMimport-condition types) now carry.jsextensions. Thecommonjsdeclarations remain extensionless, which is correct for therequirecondition.nodenextconsumer smoke test: extensionless declarations fail withTS2305; the new build resolves cleanly (tscexit 0).13 suites, 68 tests).Notes
@babel/coretransitively). bob 0.42 bundles its owntypescript@6for declaration emission; the workspace continues to typecheck and test against its pinnedtypescript@~4.6.engines); CI/local Node 22 satisfies this.🤖 Generated with Claude Code