Skip to content

fix(react-native): fix TS2742 build error and retarget rollup/webpack migrations to beta.24#35896

Merged
FrozenPandaz merged 2 commits into
masterfrom
fix/react-native-build-ts2742
Jun 5, 2026
Merged

fix(react-native): fix TS2742 build error and retarget rollup/webpack migrations to beta.24#35896
FrozenPandaz merged 2 commits into
masterfrom
fix/react-native-build-ts2742

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Contributor

Current Behavior

  • The @nx/react-native library build (tsc --build tsconfig.lib.json) fails with TS2742. The exported addJest helper has no explicit return type, so TypeScript infers GeneratorCallback and can only name it through a non-portable, pnpm-hashed @nx/devkit path when emitting the declaration file.
  • The rewrite-rollup-internal-subpath-imports and rewrite-webpack-internal-subpath-imports migrations are scheduled to run at 23.0.0-beta.25.

Expected Behavior

  • addJest is explicitly annotated as Promise<GeneratorCallback> (imported from @nx/devkit), giving tsc a portable name to emit. The library now builds cleanly.
  • Both internal-subpath-import migrations are retargeted to 23.0.0-beta.24 to align with the rest of the 23.0.0 migration batch.

Related Issue(s)

N/A

The inferred return type referenced @nx/devkit via a non-portable pnpm
path, breaking the library build. Annotate as Promise<GeneratorCallback>.
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner June 5, 2026 21:00
@FrozenPandaz FrozenPandaz requested a review from leosvelperez June 5, 2026 21:00
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 5, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit ec5c5db
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a2338d57bff9c0008ea53b2
😎 Deploy Preview https://deploy-preview-35896--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 5, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit ec5c5db
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a2338d53cd1a70008fce2b1
😎 Deploy Preview https://deploy-preview-35896--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Jun 5, 2026

View your CI Pipeline Execution ↗ for commit ec5c5db

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 43m 9s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 1m View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 18s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗
nx affected -t e2e-macos-local --parallel=1 --b... ✅ Succeeded 33m 9s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-05 21:47:45 UTC

@FrozenPandaz FrozenPandaz enabled auto-merge (squash) June 5, 2026 21:14
@FrozenPandaz FrozenPandaz merged commit 5e8ee67 into master Jun 5, 2026
27 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/react-native-build-ts2742 branch June 5, 2026 21:48
vrxj81 pushed a commit to vrxj81/nx that referenced this pull request Jun 7, 2026
… migrations to beta.24 (nrwl#35896)

## Current Behavior

- The `@nx/react-native` library build (`tsc --build tsconfig.lib.json`)
fails with **TS2742**. The exported `addJest` helper has no explicit
return type, so TypeScript infers `GeneratorCallback` and can only name
it through a non-portable, pnpm-hashed `@nx/devkit` path when emitting
the declaration file.
- The `rewrite-rollup-internal-subpath-imports` and
`rewrite-webpack-internal-subpath-imports` migrations are scheduled to
run at `23.0.0-beta.25`.

## Expected Behavior

- `addJest` is explicitly annotated as `Promise<GeneratorCallback>`
(imported from `@nx/devkit`), giving `tsc` a portable name to emit. The
library now builds cleanly.
- Both internal-subpath-import migrations are retargeted to
`23.0.0-beta.24` to align with the rest of the `23.0.0` migration batch.

## Related Issue(s)

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants