th3rdwave / react-native-safe-area-context

A flexible way to handle safe area insets in JS. Also works on Android and Web!
MIT License
2.18k stars 200 forks source link

Bleeding edge fails on generateCodegenArtifactsFromSchema #382

Open djMax opened 1 year ago

djMax commented 1 year ago

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

jacobp100 commented 1 year ago

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?

djMax commented 1 year ago

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 commented 1 year ago

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

jacobp100 commented 1 year ago

Is this still an issue?

artemis-prime commented 1 year ago

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

wdcs-harshitpadalia commented 1 year ago

I am also facing this issue

jruvel commented 1 year ago

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

jacobp100 commented 1 year ago

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 commented 1 year ago

Is this for Android?

DreamakerDimas commented 1 year ago

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

ludal commented 1 year ago

Had same issue and solved it by adding

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

in android/app/build.gradle