Open raulalhena opened 2 months ago
I follow the installation and setup steps and I got this error.
-babel.config.js:
module.exports = { presets: [ 'module:metro-react-native-babel-preset', '@babel/preset-typescript', ], plugins: [ ['react-native-reanimated/plugin'], [ 'babel-plugin-root-import', { rootPathPrefix: '~', rootPathSuffix: 'src', }, ], 'babel-plugin-transform-typescript-metadata', ['@babel/plugin-proposal-decorators', { legacy: true }], ['@babel/plugin-proposal-class-properties', { loose: true }], ['@babel/plugin-transform-private-methods', { loose: true }], ['@babel/plugin-transform-private-property-in-object', { loose: true }] ], };
import {Database} from '@nozbe/watermelondb'; import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
import schema from './schema'; // import migrations from './migrations'; import Treatment from './treatements'; import Visit from './visits';
const adapter = new SQLiteAdapter({ dbName: 'appv3', schema, // migrations, jsi: true / Platform.OS === 'ios' /, onSetUpError: error => { console.log(error); }, });
export const database = new Database({ adapter, modelClasses: [ Treatment, Visit, // and so on ], });
import { appSchema, tableSchema } from "@nozbe/watermelondb" import { tableName } from './table-name';
const schema = appSchema({ version: 1, tables: [ tableSchema({ name: tableName.VISITS, columns: [ { name: 'name', type: 'string' } ], }), tableSchema({ name: tableName.TREATMENTS, columns: [ { name: 'name', type: 'string' } ], }), ], });
export default schema;
Try jsi: false when you're using new arch. Will be added support to new arch soon.
I follow the installation and setup steps and I got this error.
-babel.config.js:
module.exports = { presets: [ 'module:metro-react-native-babel-preset', '@babel/preset-typescript', ], plugins: [ ['react-native-reanimated/plugin'], [ 'babel-plugin-root-import', { rootPathPrefix: '~', rootPathSuffix: 'src', }, ], 'babel-plugin-transform-typescript-metadata', ['@babel/plugin-proposal-decorators', { legacy: true }], ['@babel/plugin-proposal-class-properties', { loose: true }], ['@babel/plugin-transform-private-methods', { loose: true }], ['@babel/plugin-transform-private-property-in-object', { loose: true }] ], };
import {Database} from '@nozbe/watermelondb'; import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
import schema from './schema'; // import migrations from './migrations'; import Treatment from './treatements'; import Visit from './visits';
const adapter = new SQLiteAdapter({ dbName: 'appv3', schema, // migrations, jsi: true / Platform.OS === 'ios' /, onSetUpError: error => { console.log(error); }, });
export const database = new Database({ adapter, modelClasses: [ Treatment, Visit, // and so on ], });
import { appSchema, tableSchema } from "@nozbe/watermelondb" import { tableName } from './table-name';
const schema = appSchema({ version: 1, tables: [ tableSchema({ name: tableName.VISITS, columns: [ { name: 'name', type: 'string' } ], }), tableSchema({ name: tableName.TREATMENTS, columns: [ { name: 'name', type: 'string' } ], }), ], });
export default schema;