react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Bleeding edge fails on generateCodegenArtifactsFromSchema

Open djMax opened this issue 1 year ago • 11 comments

I am on RN 0.72 using Fabric and unable to build release mode on android with the following error:

> Task :react-native-safe-area-context:generateCodegenArtifactsFromSchema FAILED
/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js:249
  return Object.keys(aliasMap)
                ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at createStructsString (/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js:249:17)
    at /Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js:488:23
    at Array.flatMap (<anonymous>)
    at generate (/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js:481:48)
    at Object.generate (/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/@react-native/codegen/lib/generators/RNCodegen.js:194:9)
    at Object.generateSpec [as execute] (/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/react-native/scripts/codegen/generate-specs-cli-executor.js:97:13)
    at main (/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/react-native/scripts/generate-specs-cli.js:51:12)
    at Object.<anonymous> (/Users/memetral/dev/personal/rn-monorepo-fabric/node_modules/react-native/scripts/generate-specs-cli.js:61:1)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)

Bare bones project here https://github.com/djMax/rn-monorepo-fabric

djMax avatar Apr 28 '23 12:04 djMax

0.72 is a release candidate - but it would be nice to get this fixed before it goes live

Is this something you may be able to help with?

jacobp100 avatar Apr 28 '23 15:04 jacobp100

Help fixing, not sure, because I know nothing about the codegen flow. But I am happy to try, to chase leads, and to test the heck out of it.

djMax avatar Apr 28 '23 16:04 djMax

So this same error happens with react-native-community_datetimepicker, if that provides any leads

djMax avatar May 01 '23 00:05 djMax

Is this still an issue?

jacobp100 avatar May 09 '23 20:05 jacobp100

What was the resolution exactly?? @jacobp100 ? I'm getting this with 0.72.0-rc.1, which is asked for by react-native-reanimated.

artemis-prime avatar May 30 '23 23:05 artemis-prime

I am also facing this issue

wdcs-harshitpadalia avatar Jun 30 '23 07:06 wdcs-harshitpadalia

We are seeing same issue. 0.72.3 RN and 4.7.1 react-native-safe-area-context

jruvel avatar Jul 21 '23 15:07 jruvel

This issue has got a help wanted tag

Remember that fabric in RN is still considered experimental. I'd recommend sticking with the old arch unless you're able to fix these sort of issues and contribute the fixes back to projects

jacobp100 avatar Jul 21 '23 15:07 jacobp100

Is this for Android?

jacobp100 avatar Jul 26 '23 11:07 jacobp100

Having the same issue. RN: 0.72.1

Getting this error at least from these libraries: react-native-async-storage: 1.19.2 react-native-bootsplash: 3.7.5 react-native-camera-roll: 5.3.1

I guess if I keep removing libraries from dependency I will get the same for react-native-safe-area-context as well.

Does anyone know what causes this issue? It's the only thread that I found about this error.

I also have monorepo in the project so I am wondering if it is the source

DreamakerDimas avatar Aug 21 '23 16:08 DreamakerDimas

Had same issue and solved it by adding

react {
    codegenDir = file("../../node_modules/@react-native/codegen")
}

in android/app/build.gradle

ludal avatar Oct 13 '23 10:10 ludal