App codegen reads the jsSrcsDir of a library with `includesGeneratedCode: true` and prints "No modules to process" for it

Đang mở Phù hợp với người mới
#60,358 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@lazerg đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #60359 của @lazerg — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, node.js, react
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với packages/react-native/scripts/codegen/generate-artifacts-executor/index.js, đặc biệt là execute, generateSchemaInfos và mustGenerateNativeCode, sau đó kiểm tra packages/react-native-codegen/src/cli/combine/combine-js-to-schema.js. Chạy repro.sh được cung cấp trong container node:24 và sử dụng thư viện IncludedLibrarySpec để tái hiện đầu ra bổ sung. Thay đổi cần lọc các thư viện có includesGeneratedCode: true trước khi generateSchemaInfos đọc jsSrcsDir của chúng; hoàn tất nghĩa là không xuất hiện cả quá trình xử lý lẫn dòng “No modules to process”, trong khi codegen vẫn hoàn tất thành công và thoát với mã 0.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Needs: Triage :mag: Type: New Architecture
Description

An app's codegen reads the jsSrcsDir of every codegen-enabled library, a library whose codegenConfig sets includesGeneratedCode: true among them, though it then generates no code for that library. When that library's jsSrcsDir holds no file named Native… or …NativeComponent, the app's codegen, which pod install runs, prints No modules to process in combine-js-to-schema-cli. […] for it through console.error.

On main (32260ddbee), execute builds generateSchemaInfos(libraries, platform) for every library and only then filters the result by mustGenerateNativeCode(projectRoot, schemaInfo), which reads schemaInfo.library alone. generateSchemaInfo prints Processing <name> and combines the schema of the library's jsSrcsDir, and combineSchemasInFileList prints the error when that schema has no module. #48621 reports the same read stopping an app's codegen on a spec it cannot parse, for a library with includesGeneratedCode: true; it was closed as stale.

Expected: the app's codegen leaves the jsSrcsDir of a library with includesGeneratedCode: true unread, and prints neither line for it. With the libraries filtered before generateSchemaInfos (generateSchemaInfos(libraries.filter(library => mustGenerateNativeCode(projectRoot, {library})), platform)), the reproducer's codegen prints neither line, still ends with [Codegen] Done. and exits 0.

Steps to reproduce
  1. Clone the reproducer below. Its ReproducerApp/included-library/package.json holds:
    "codegenConfig": {
      "name": "IncludedLibrarySpec",
      "type": "modules",
      "jsSrcsDir": "src",
      "includesGeneratedCode": true
    }
    
    and its src/ holds only index.ts.
  2. In the clone, run repro.sh in a node:24 container:
    docker run --rm -v .:/repro:ro node:24 bash /repro/repro.sh
    
    It makes a new app whose dependencies are react-native@nightly and ./included-library, and runs the app's iOS codegen with the output path pod install passes:
    node node_modules/react-native/scripts/generate-codegen-artifacts.js -p . -t ios -o ios
    
  3. Expected: no line for IncludedLibrarySpec, whose code the app's codegen does not generate. Actual:
    [Codegen] Processing IncludedLibrarySpec
    [Codegen] Searching for podspec in the project dependencies.
    No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
    
    and nothing is generated for the library. docker run --rm -v .:/repro:ro node:24 bash /repro/repro.sh 0.88.1 prints the same on 0.88.1, and bash repro.sh on a Windows host the same on the nightly.
React Native Version

0.88.1

Affected Platforms

Build - Linux, Build - Windows

Areas

Codegen

Output of npx @react-native-community/cli info
System:
  OS: Linux 6.18 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (24) x64 AMD Ryzen 9 9950X3D 16-Core Processor
  Memory: 120.08 GB / 125.63 GB
  Shell:
    version: 5.2.15
    path: /bin/bash
Binaries:
  Node:
    version: 24.22.3
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 11.19.1
    path: /usr/local/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native:
    installed: 0.90.0-nightly-20261128-32260ddbe
    wanted: ^0.90.0-nightly-20261128-32260ddbe
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
react-native 0.90.0-nightly-20261128-32260ddbe
[…]
== node node_modules/react-native/scripts/generate-codegen-artifacts.js -p . -t ios -o ios
[Codegen] Analyzing package.json
[Codegen] Could not find generated autolinking output at: /tmp/tmp.sVy6pDkenL/ios/build/generated/autolinking/autolinking.json
[Codegen] Could not find React Native config in: .
[Codegen] Searching for codegen-enabled libraries in the app.
[Codegen] The "codegenConfig" field is not defined in package.json. Assuming there is nothing to generate at the app level.
[Codegen] Could not find generated autolinking output at: /tmp/tmp.sVy6pDkenL/ios/build/generated/autolinking/autolinking.json
[Codegen] Searching for codegen-enabled libraries in the project dependencies.
[Codegen] Found included-library
[Codegen] Found react-native
[Codegen] Searching for codegen-enabled libraries in react-native.config.js
[Codegen] Processing IncludedLibrarySpec
[Codegen] Searching for podspec in the project dependencies.
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
[Codegen] Processing FBReactNativeSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] [Codegen - FBReactNativeSpec] Skipping iOS code generation for FBReactNativeSpec as it has been generated already.
[Codegen] Generating RCTThirdPartyComponentsProvider.h
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTThirdPartyComponentsProvider.h
[Codegen] Generating RCTThirdPartyComponentsProvider.mm
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTThirdPartyComponentsProvider.mm
[Codegen] Generating RCTModulesProvider.h
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTModuleProviders.h
[Codegen] Generating RCTModuleProviders.mm
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTModuleProviders.mm
[Codegen] Generating RCTAppDependencyProvider
[Codegen] Generated artifact: ios/build/generated/ios/ReactAppDependencyProvider/RCTAppDependencyProvider.h
[Codegen] Generated artifact: ios/build/generated/ios/ReactAppDependencyProvider/RCTAppDependencyProvider.mm
[Codegen] Generated podspec: ios/build/generated/ios/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec
[Codegen] Generated podspec: ios/build/generated/ios/ReactCodegen/ReactCodegen.podspec
[Codegen] Generating Package.swift
[Codegen] Generated artifact: ios/build/generated/ios/Package.swift
[Codegen] Done.
exit 0
generated for IncludedLibrarySpec: nothing
SUMMARY: react-native 0.90.0-nightly-20261128-32260ddbe's app codegen reads the jsSrcsDir of a library that sets includesGeneratedCode: true, and prints No modules to process for it
MANDATORY Reproducer

https://github.com/YevheniiKotyrlo/react-native-codegen-included-generated-code

Screenshots and Videos

No response

Ngôn ngữ chính
C++
Star
127k
Fork
25.4k
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
287

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của react/react-native

Tất cả issue của react/react-native

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.