App codegen reads the jsSrcsDir of a library with `includesGeneratedCode: true` and prints "No modules to process" for it
Maintainer thường phản hồi trong vòng 1 ngày
Đá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ả
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
- Clone the reproducer below. Its
ReproducerApp/included-library/package.jsonholds:
and its"codegenConfig": { "name": "IncludedLibrarySpec", "type": "modules", "jsSrcsDir": "src", "includesGeneratedCode": true }src/holds onlyindex.ts. - In the clone, run
repro.shin anode:24container:
It makes a new app whose dependencies aredocker run --rm -v .:/repro:ro node:24 bash /repro/repro.shreact-native@nightlyand./included-library, and runs the app's iOS codegen with the output pathpod installpasses:node node_modules/react-native/scripts/generate-codegen-artifacts.js -p . -t ios -o ios - Expected: no line for
IncludedLibrarySpec, whose code the app's codegen does not generate. Actual:
and nothing is generated for the library.[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.docker run --rm -v .:/repro:ro node:24 bash /repro/repro.sh 0.88.1prints the same on 0.88.1, andbash repro.shon 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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react/react-native
-
Flow Needs: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
react/react-native#60447 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Rect::containsPoint` is not `const`, so a `const Rect` cannot be asked whether it holds a pointCó thể đã có người làm @lazerg đã nhận 3 ngày trước. Đang mởNeeds: Triage :mag:
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
react/react-native#60349 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs: Triage :mag: Platform: Android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
react/react-native#60177 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
react/react-native#60091 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ReactNative-application.cmake links autolinked libraries to common_flags with the plain target_link_libraries signature, so a library that uses PRIVATE fails the app's CMake configureCó thể đã có người làm @JagguDada01 đã nhận 5 ngày trước. Đang mởNeeds: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
react/react-native#60000 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của react/react-native
Issue tương tự
-
[bug] [documentation] Document STRPCCMD setup and that PCCMD must be quoted to keep lowercaseĐang mởbug documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TransformInteract: a circle drag through the centre sets Scale to its minimum, which can't grow backĐang mởdifficulty:easy prio:low type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NatronGitHub/openfx-supportext#311 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CachyOS/packageinstaller#211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenEmu-Silicon/OpenEmu-Silicon#920 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày