Open myfoostrong opened 5 months ago
I can confirm we've also run into this exact same error, and so have temporarily removed using that adapter in our internal testing of our v5 -> v6 migration.
Would love to switch back to the Sqlite adapter soon as I believe query performance in particular is much better in an RN app.
Experiencing the same issue. After several version tests, only version 2.0.30 seems to work . All others are in this Path: datastore-storage-adapter/dist/umd not datastore-storage-adapter/dist/ and when you manually change it, it fails when you they to build the app.
Experiencing the same issue. After several version tests, only version 2.0.30 seems to work . All others are in this Path: datastore-storage-adapter/dist/umd not datastore-storage-adapter/dist/ and when you manually change it, it fails when you they to build the app.
This worked for me as well, both in a fresh Expo app as well as my exisiting app
Experiencing the same issue. After several version tests, only version 2.0.30 seems to work. All others are in this Path: datastore-storage-adapter/dist/umd not datastore-storage-adapter/dist/ and when you manually change it, it fails when you they to build the app.
This worked for me as well, both in a fresh Expo app as well as my existing app
Yeah, but I don't think it is efficient, as my app still loads from the cloud directly and takes time to process queries. This looks more like an indication that the offline functionality of datastore is not working. I've been sweating my ass for days now looking for a workaround.
@david-mcafee pls can you help me out with this: I've been encountering slow query performance in my app's AWS Amplify DataStore since it started getting more usage. Despite my efforts to troubleshoot, I haven't been able to find a solution. I suspect that the performance degradation might be linked to the aws-amplify-datastore-sqlite-adapter-expo. Here are the dependencies I'm currently using:
"@aws-amplify/datastore-storage-adapter": "^2.0.30", "@react-native-async-storage/async-storage": "1.17.11", "aws-amplify": "^5.3.14", "expo": "~48.0.15",
The aws-amplify/datastore-storage-adapter vision I'm using is old and this is because of the path wrong i get when i run the more recent versions as started below.
Thanks in anticipation of your response.
Hi @myfoostrong 👋 thanks for raising this issue. I think I've run into this recently as well. Have you tried running npx expo run:ios
instead?
Hi @chrisbonifacio, the problem I see with this is that even if it is resolved with npx expo run: ios to run on the simulator, when you run eas build one would encounter the same issue there.
In addition to fixing this broken import, Expo has just released SDK 50 which introduces a big update to their sqlite
capability (see their release notes here).
I don't want to muddy the waters with this ticket, but other than say I hope DataStore supports sqlite well on Expo platforms for a long time and that the above Expo change helps this over time.
Looking forward to updates to this ticket with a fix.
Same issue
Same issue using Expo 50
tl;dr : It's a file path issue. Idk how to contact aws team. help!
Follow this file path:
node-modules > @aws-amplify > dtatastore-storage-adapter > ExpoSQLiteAdapter > index.js
The file contains:
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('../dist/aws-amplify-datastore-sqlite-adapter-expo.min.js');
} else {
module.exports = require('../dist/aws-amplify-datastore-sqlite-adapter-expo.js');
}
Currently, the folder arrangement looks like this:
"@aws-amplify/datastore-storage-adapter": "^2.1.13"
-Latest version
In one of my older projects 3 months ago , the folder arrangement looked like this:
"@aws-amplify/datastore-storage-adapter": "^2.0.40"
Help me contact AWS Team to change the modile.exports to the correct file path.
Temporary Fix:
npm install @aws-amplify/datastore-storage-adapter@2.0.40
I think it's obvious and super simple to reproduce this error, what can we do to speed up this issue and tag it as a bug?
Apologies for the delay. We're able to reproduce this internally.
Here's a minimum repro app for the team: https://github.com/chrisbonifacio/amplify-expo-app
In the meantime, please use @aws-amplify/datastore-storage-adapter@2.0.40
. Not sure if necessary, might just be something I did wrong, but I also had to install expo-sqlite
alongside it to work.
I kept getting requireNativeModule
ExpoSQLite errors otherwise.
Apologies for the delay. We're able to reproduce this internally.
Here's a minimum repro app for the team: https://github.com/chrisbonifacio/amplify-expo-app
In the meantime, please use
@aws-amplify/datastore-storage-adapter@2.0.40
. Not sure if necessary, might just be something I did wrong, but I also had to installexpo-sqlite
alongside it to work.I kept getting
requireNativeModule
ExpoSQLite errors otherwise.
Same, I also had to make sure expo-sqlite
was installed for it to work, but otherwise using DataStore in my app appears to be working just fine with this temporary fix.
@aws-amplify/datastore-storage-adapter@2.0.40
@chrisbonifacio When do you (team) plan to fix the issue related to the path? Also, switching to 2.0.40 is worth in terms of performance?
I currently have a PR open to fix the broken subpaths, but I also wanted to note that Expo Go is currently not officially supported by Amplify V6. However, Expo and React Native CLI apps are supported.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication, REST API, DataStore, Storage
Amplify Version
v6
Amplify Categories
auth, storage, api, Not applicable
Backend
Amplify CLI
Environment information
Describe the bug
Using a newly generated application, following the Datastore web guide the app fails to load the bundle with a missing reference to the library
aws-amplify-datastore-sqlite-adapter-expo
Looking in the directory mentioned,
./node_modules/@aws-amplify/datastore-storage-adapter/dist/
I don't see the the expected file,aws-amplify-datastore-sqlite-adapter-expo[.min].js
, but I do see them indatastore-storage-adapter/dist/umd
. Changing therequire
string toumd
at least stops the error, and allows the app to load, but I haven't tried using the datastore service yet.Expected behavior
The application to successfully load in Expo Go.
Reproduction steps
App.js
DataStore.configure({ storageAdapter: ExpoSQLiteAdapter });
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
iPhone14 Emulator
Mobile Operating System
iOS16.4
Mobile Browser
Expo Go
Mobile Browser Version
No response
Additional information and screenshots
No response