Shopify / react-native-skia

High-performance React Native Graphics using Skia
https://shopify.github.io/react-native-skia
MIT License
6.98k stars 452 forks source link

"Timed out waiting for modules to be invalidated" error after reloading app over metro [iOS] #2516

Closed callmehallo closed 4 months ago

callmehallo commented 4 months ago

Description

When starting the application and reloading it over metro, the app crashes with following error:

Timed out waiting for modules to be invalidated

__26-[RCTCxxBridge invalidate]_block_invoke
    RCTCxxBridge.mm:1296
decltype(std::declval<void () block_pointer __strong&>()()) std::__1::__invoke[abi:ue170006]<void () block_pointer __strong&>(&&, decltype(std::declval<void () block_pointer __strong&>()())&&...)
std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator()()
std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const
std::__1::function<void ()>::operator()() const
facebook::react::tryAndReturnError(std::__1::function<void ()> const&)
-[RCTCxxBridge _tryAndHandleError:]
__NSThreadPerformPerform
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
__CFRunLoopDoSource0
__CFRunLoopDoSources0
__CFRunLoopRun
CFRunLoopRunSpecific
+[RCTCxxBridge runRunLoop]
__NSThread__start__
_pthread_start
thread_start

image

metro doesn't show any error or log. there's nothing else shown inside xcode except "Timed out waiting for modules to be invalidated":

image

Background Information

Version

1.3.5

Steps to reproduce

  1. Start App.

  2. Reload over metro. (pressing 'r' inside the metro cli)

  3. Wait 1 minute.

Snack, code example, screenshot, or link to a repository

Sadly I am not able to reproduce it in expo

I don't know if it's relevant, but here's my package.json


  "name": "App",
  "version": "0.24.0",
  "private": true,
  "scripts": {[...]}",
  "dependencies": {
    "@hookform/resolvers": "3.6.0",
    "@notifee/react-native": "7.8.2",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-firebase/analytics": "14.11.1",
    "@react-native-firebase/app": "14.11.1",
    "@react-native-firebase/crashlytics": "14.11.1",
    "@react-native-firebase/messaging": "14.11.1",
    "@react-native-firebase/perf": "14.11.1",
    "@react-navigation/bottom-tabs": "6.5.20",
    "@react-navigation/native": "6.1.17",
    "@react-navigation/native-stack": "6.9.26",
    "@reduxjs/toolkit": "2.2.5",
    "@shopify/react-native-skia": "1.3.5",
    "async-mutex": "0.4.0",
    "date-fns": "3.6.0",
    "date-fns-tz": "3.1.3",
    "jwt-decode": "3.1.2",
    "lodash": "4.17.21",
    "node-polyglot": "2.5.0",
    "react": "18.2.0",
    "react-hook-form": "7.52.0",
    "react-native": "0.71.6",
    "react-native-auth0": "3.2.1",
    "react-native-code-push": "8.0.2",
    "react-native-gesture-handler": "2.17.0",
    "react-native-reanimated": "3.10.1",
    "react-native-safe-area-context": "4.10.5",
    "react-native-screens": "3.32.0",
    "react-native-video": "5.2.1",
    "react-redux": "9.1.2",
    "redux-persist": "6.0.0",
    "socket.io-client": "4.7.2",
    "yup": "1.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@trivago/prettier-plugin-sort-imports": "^4.1.1",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/lodash": "^4.14.191",
    "@types/node-polyglot": "^2.4.2",
    "@types/react": "^18.0.24",
    "@types/react-native-auth0": "^2.17.4",
    "@types/react-native-video": "^5.0.20",
    "@types/react-test-renderer": "^18.0.0",
    "appcenter-cli": "^2.14.0",
    "babel-jest": "^29.2.1",
    "babel-plugin-module-resolver": "^5.0.0",
    "basil-ws-flipper": "^1.0.0",
    "eslint": "^8.19.0",
    "eslint-config-prettier": "^8.6.0",
    "eslint-plugin-prettier": "^4.2.1",
    "husky": "^8.0.3",
    "jest": "^29.2.1",
    "jest-junit": "^16.0.0",
    "lint-staged": "^13.1.1",
    "metro-react-native-babel-preset": "0.73.7",
    "prettier": "^2.8.4",
    "react-native-flipper": "0.164.0",
    "react-test-renderer": "18.2.0",
    "redux-flipper": "^2.0.3",
    "typescript": "4.9.5"
  },
  "jest": {
    "maxWorkers": 2,
    "testTimeout": 10000,
    "preset": "react-native",
    "transformIgnorePatterns": [
      "node_modules/(?!(react-native|@react-native|react-redux)/)"
    ]
  },
  "jest-junit": {
    "outputDirectory": "artifacts/test-results/junit",
    "outputName": "jest-junit.xml",
    "uniqueOutputName": "true",
    "reportTestSuiteErrors": "true",
    "moduleDirectories": [
      "<rootDir>/",
      "node_modules"
    ]
  }
}```
xkelxmc commented 4 months ago

Same problem

    "@shopify/react-native-skia": "1.3.7",
    "expo": "^51.0.17",
    "expo-dev-client": "~4.0.19",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-native": "0.74.2",
    ...
DaveGlad commented 4 months ago

Same problem 😶

    "@shopify/react-native-skia": "1.3.7",
    "expo": "^51.0.17",
    "expo-dev-client": "~4.0.19",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-native": "0.74.2",
    ...
basharmengana-dev commented 4 months ago

Same 😢

    "@shopify/react-native-skia": "^1.3.6",
    "react": "18.2.0",
    "react-native": "0.74.2",
    "react-native-gesture-handler": "^2.16.2",
    "react-native-reanimated": "^3.12.0"
LMarcinkowski commented 4 months ago

Same. Similar version as above.

napsta32 commented 4 months ago

Same. I am using victory native.

"@shopify/react-native-skia": "^1.3.7",
"react": "18.2.0",
"react-native": "0.74.3",
"react-native-gesture-handler": "^2.17.1",
"react-native-reanimated": "^3.13.0",
"victory-native": "^41.0.1"

If I remove all the charts, I don't get the error. As soon as I add a graphics it fails to reload.

EDIT: This is not reproducible if I downgrade @shopify/react-native-skia to 1.3.4

natuanorg commented 4 months ago

same problem

DaveGlad commented 4 months ago

I had this problem, after building my application with the command eas build --profile development-simulator --platform iosthen launch the application I no longer have this problem

DarkShtir commented 4 months ago

Same issue

"@shopify/react-native-skia": "1.3.8",
"react": "18.3.1",
"react-native": "0.73.9",
"react-native-reanimated": "3.14.0",
"react-native-gesture-handler": "2.17.1",
ovidb commented 4 months ago

We have the exact same issue and we ended up reverting, which fixed the issue

carlosriveroib commented 4 months ago

Same. I am using victory native.

"@shopify/react-native-skia": "^1.3.7",
"react": "18.2.0",
"react-native": "0.74.3",
"react-native-gesture-handler": "^2.17.1",
"react-native-reanimated": "^3.13.0",
"victory-native": "^41.0.1"

If I remove all the charts, I don't get the error. As soon as I add a graphics it fails to reload.

EDIT: This is not reproducible if I downgrade @shopify/react-native-skia to 1.3.4

Same as you, I'm using victory-native, same error with 1.3.8 but if I downgrade to 1.3.4 I don't get the error

nat-jones commented 4 months ago

Are you installing with npx expo install @shopify/react-native-skia? I had the same problem installing with a simple npm install @shopify/react-native-skia, but this + a rebuild fixed my issues.

omarbakr2020 commented 4 months ago

Same problem here. Any solution ?

wcandillon commented 4 months ago

Thank you for reporting this. We were also affected by this issue. We will publish a fix for it today.

github-actions[bot] commented 4 months ago

:tada: This issue has been resolved in version 1.3.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket: