Closed sonikro closed 6 years ago
Hello @radex , thanks for the reply.
I created a sample project, where we can reproduce this problem -> https://github.com/sonikro/watermelontest
Just clone the repo, yarn, and react-native run-android.
The babel config of my original project is this:
{
"presets": [
"module:metro-react-native-babel-preset"
],
"env": {
"production": {
"plugins": [
"transform-remove-console"
]
}
},
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
}
Regarding the snippet of the code generated by the bundler,I got this... (The exact character is inside the performanceNow(), but I got some text before, and some after.
f(type === 'setTimeout' || type === 'setInterval' || type === 'setImmediate') { \n callback(); \n } else if (type === 'requestAnimationFrame') { \n callback(performanceNow()); \n } else if (type === 'requestIdleCallback') { \n callback({ \n timeRemaining: function timeRemaining() { \n return Math.max(0, FRAME_DURATION - (performanceNow() - frameTime)); \n }, \n didTimeout: !!didTimeout\n }); \n } else { \n console.error('Tried to call a callback with invalid type: ' + type); \n } \n } catch (e) { \n if (!errors) { \n errors = [e]; \n } else { \n errors.push(e); \n } \n } \n\n if (__DEV__) { \n Systrace.endEvent(); \n } \n }\n\n function _callImmediatesPass() { \n if (__DEV__) { \n Systrace.beginEvent('callImmediatesPass()'); \n } \n\n if (immediates.length > 0) {
ok will try to check tomorrow
Hello @radex , I managed to find a workaround for the issue.
The problem was due to the old version of JSC that is shipped by default.
I've installed jsc-android@236355.0.0, and everything worked.
However, I believe that jsc-android is now mandatory for WatermelonDB to work properly.
Thanks for the library, and keep up the good work
Interesting!
However, I believe that jsc-android is now mandatory for WatermelonDB to work properly.
Hm, that's not good! I guess there's a missing babel transformation maybe?
@sonikro is this something that worked before the latest release of 🍉 or did you encounter this the first time you wanted to use 🍉 ?
This is the problematic part (adapters/sqlite/index):
function $If_3() {
return $If_2.call(this);
}
}
function $If_2() {
return $return();
}
is a regression, because that's new code. Huh. Maybe a fast-async bug… or a missing transformation?
For now, I'll just note this in docs as a workaround, since I use jsc-android and it's fine. Would very much appreciate if someone contributed to the 🍉 babel config to fix this
OK, nevermind, I made an experimental NPM build which replaces fast-async with default async thing.
@sonikro Could you please test if the 0.8.0-5-fix-android
build works for you correctly (with or without jsc-android)? I'd very much appreciate it
@sonikro is this something that worked before the latest release of or did you encounter this the first time you wanted to use ?
I encountered it the first time. I started using Watermelon DB this week.
I'll test it today, and will let you know of the results.
thanks!
@radex , the version 0.8.0-5-fix-android
is working in both scenarios, with the updated JSC and without it.
Thanks :)
Great, released. Closing.
Hello everyone,
First of all, thanks for this awesome project.
I'm trying to use WatermelonDB in my React-native project, however I've been facing an error related to strict-mode:
This error only shows up when I import SQLiteAdapter, and try to create it
If I comment the SQLiteAdapter part, the project runs normally (of course, the Database wont work, because of the missing adapter, but I won't run into this strict mode error)
This is my package.json
Does anyone have any idea what might be going on ?
EDIT1: I dont get this error, if Im debugging the app. Edit2: I tried implementing watermelonDB in a clean app (react-native init), and I got the same error. I even tried using RN 0.56.0, but the same thing happened....