mkuczera / react-native-haptic-feedback

React-Native Haptic Feedback for iOS with Android similar behaviour.
MIT License
855 stars 103 forks source link

New arch not working (crashing at pod install) #95

Closed canpoyrazoglu closed 1 year ago

canpoyrazoglu commented 1 year ago

I've read that v2.0 supports the React Native Fabric ("new arch"). I'm on v2.0.2 but if I pod install with RCT_NEW_ARCH_ENABLED=1 pod install codegen runs successfully on all the other pods but on react-native-haptic-feedback it fails with:

Here is the error:

Error: ENOENT: no such file or directory, lstat '/path/to/my/project/node_modules/react-native-haptic-feedback/src'
    at Object.lstatSync (node:fs:1561:3)
    at /path/to/my/project/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:26:10
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/path/to/my/project/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:25:10)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  errno: -2,
  syscall: 'lstat',
  code: 'ENOENT',
  path: '/path/to/my/project/node_modules/react-native-haptic-feedback/src'
}
Error: Command failed: node /path/to/my/project/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js --platform ios /var/folders/_m/n09zdv0j27nc57hp777p49xr0000gn/T/RNHapticFeedbackSpecKdJ631/schema.json /path/to/my/project/node_modules/react-native-haptic-feedback/src
/path/to/my/project/node_modules/flow-parser/flow_parser.js:807
throw a}function
^

Error: ENOENT: no such file or directory, lstat '/path/to/my/project/node_modules/react-native-haptic-feedback/src'
    at Object.lstatSync (node:fs:1561:3)
    at /path/to/my/project/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:26:10
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/path/to/my/project/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:25:10)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  errno: -2,
  syscall: 'lstat',
  code: 'ENOENT',
  path: '/path/to/my/project/node_modules/react-native-haptic-feedback/src'
}

    at checkExecSyncError (node:child_process:861:11)
    at execSync (node:child_process:932:15)
    at executeNodeScript (/path/to/my/project/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:38:3)
    at generateSchema (/path/to/my/project/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:314:3)
    at /path/to/my/project/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:373:26
    at Array.forEach (<anonymous>)
    at generateNativeCodegenFiles (/path/to/my/project/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:362:13)
    at Object.execute (/path/to/my/project/node_modules/react-native/scripts/codegen/generate-artifacts-executor.js:532:5)
    at Object.<anonymous> (/path/to/my/project/node_modules/react-native/scripts/generate-codegen-artifacts.js:64:10) {
  status: 7,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 2f 55 73 65 72 73 2f 43 61 6e 2f 44 6f 63 75 6d 65 6e 74 73 2f 50 72 6f 67 72 61 6d 6d 69 6e 67 2f 52 65 61 63 74 2f 44 61 56 69 6e 63 69 2f 6e 6f 64 ... 1152 more bytes>
  ],
  pid: 20816,
  stdout: <Buffer >,
  stderr: <Buffer 2f 55 73 65 72 73 2f 43 61 6e 2f 44 6f 63 75 6d 65 6e 74 73 2f 50 72 6f 67 72 61 6d 6d 69 6e 67 2f 52 65 61 63 74 2f 44 61 56 69 6e 63 69 2f 6e 6f 64 ... 1152 more bytes>
}
.

 #  from /path/to/my/project/ios/Podfile:35
 #  -------------------------------------------
 #  
 >    use_react_native!(
 #      :path => config[:reactNativePath],
 #  -------------------------------------------

[!] [Codegen] warn: using experimental new codegen integration

I've tried deleting Pods directory, Podfile.lock, and ios's build directory but no avail, still the same error.

mkuczera commented 1 year ago

This is fixed with the 2.0.3 version. Sorry for the false config