WatermelonDB
WatermelonDB copied to clipboard
cannot find installWatermelonJSI & watermelondbProvideSyncJson in scope
My source code build ios app on MacOS chip M1: success But fail if build it on MacOS chip Intel x86_64
both same:
- MacOS 12.1
- Xcode: 13.2.1 ---- and ----
- MacOS 12.0
- Xcode: 13.2.0
› Compiling @nozbe/watermelondb Pods/WatermelonDB » std_ext.swift
› Compiling @nozbe/watermelondb Pods/WatermelonDB » DatabaseBridge.swift
❌ (node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/DatabaseBridge.swift:93:13)
91 | methodQueue.sync {
92 | // swiftlint:disable all
> 93 | installWatermelonJSI(bridge as? RCTCxxBridge)
| ^ cannot find 'installWatermelonJSI' in scope
94 | }
95 | return [:]
96 | }
❌ (node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/DatabaseBridge.swift:103:9)
101 | resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
102 | var error: NSError?
> 103 | watermelondbProvideSyncJson(id.int32Value, json.data(using: String.Encoding.utf8.rawValue), &error)
| ^ cannot find 'watermelondbProvideSyncJson' in scope
104 | if let error = error {
105 | sendReject(reject, error)
106 | } else {
› Compiling @nozbe/watermelondb Pods/WatermelonDB » Database.swift
› Compiling @nozbe/watermelondb Pods/WatermelonDB » DatabaseDriver.swift
My package:
"@nozbe/watermelondb": "~0.24.0",
"expo": "^44.0.0",
"react-native": "0.64.3",
I don't know why? Please help me.
Thanks so much
I'm having exactly the same issue. Happened to me when migrating from Unimodules to Expo Modules. I found out that my build runs if I remove either Watermelon or Expo from the project, but I need them both, obviously. I'm clueless as to why Watermelon breaks instead of Expo... Xcode be Xcode.
I've also been able to reproduce this issue with a clean RN0.64.2 + Expo + Watermelon
I'm having the same issue too, used https://www.npmjs.com/package/@morrowdigital/watermelondb-expo-plugin to add watermelon support to my dev client. Building with expo run:platform
returns the error described in the title and building with EAS fails on fastlane step
I wrote an issue on plugin repo (issue) and got an answer that the plugin is incompatible with Expo v44 SDK yet, but they are saying that the issue should be resolved soon
Just to reiterate, this is a bare (react-native init) project, not an Expo one. The error seems to occur in all react native versions since expo SDK43, which deprecated unimodules in favor of expo-modules.
To reproduce the issue:
- Create a new RN project:
npx react-native init test
- Installl watermelonDB (as per instructed in the docs https://nozbe.github.io/WatermelonDB/Installation.html)
- Install Expo Modules
npx install-expo-modules
@Yarkhan I'm using Expo 43 on a bare project with expo-modules and it compiles fine. At least for me, it's only upgrading to Expo 44 that breaks it.
@Yarkhan I'm using Expo 43 on a bare project with expo-modules and it compiles fine. At least for me, it's only upgrading to Expo 44 that breaks it.
The same for me
@dmarkow Yes, I wish I've tested SDK43 before commenting, lol. I've just tested it and it works fine with Expo SDK43 npx install--expo-modules --sdk-version 43.0.0
. It seems the problem is with Expo after all, it maybe messing with Watermelon bridging or something. I will open an issue there later.
yup same for me, expo 44 breaks it.. 43 works like a charm
I've created an issue on the Expo repository. https://github.com/expo/expo/issues/15986
Expo44 is breaking a handful of other libraries as well. https://github.com/expo/expo/issues/15622
In any case, Expo is the culprit here, and I think this issued can be closed here and tracked on the Expo repository.
The good folk at Expo sent a pull request fixing this problem (https://github.com/Nozbe/WatermelonDB/pull/1249). I've tested it and it works. It is a simple fix, something to do with "old style / new style" import headers.
I'm using patch-package to get the fixes applied to my project while the pull request gets reviewed.
@Yarkhan how do I do that?
@jhonatabonadio1
- Setup patch-package in your project
- After installing watermelonDB, find these two files in your node_modules directory and make the changes: https://github.com/Nozbe/WatermelonDB/pull/1249/files
- Run
patch-package @nozbe/watermelondb
and commit the patch files until a future, fixed version is released