Summary
When a pre-existing SQLite file is require
d in a brand new project, an error is thrown, even after updating the packager settings.
Steps to Reproduce
(optionally skip these steps and check out https://github.com/danbenn/expo-sqlite-bug)
Expo SDK: 31.0.0 (latest),
Expo CLI: 2.4.0 (latest)
Create a new project:
expo init sqlite-module-bug && cd sqlite-module-bug
Create an empty SQLite database:
cd assets && sqlite3 sample.db "create table verses(field1 int);"
Add this anywhere in your App.js:
const sampleDatabase = require('./assets/sample.db');
Update packager settings:
"assetBundlePatterns": [
"assets/*"
],
"packagerOpts": {
"assetExts": ["db"]
}
Run expo:
expo start
And you’ll get this error:
Unable to resolve "./assets/sample.db" from "App.js"
Can anyone else confirm that this is a bug?