Closed ChrisHSandN closed 1 month ago
@ChrisHSandN Thanks for reporting. jeep-sqlite does not use 'crypto' module in fact the latest release of sql.js did, so the build of jeep-sqlite esm/jeep-sqlite-entry.js referred to crypto. To avoid the error message in angular create a webpack.config.js file including
module.exports = {
resolve: {
fallback: {
crypto: false
// Add more fallbacks if needed
}
}
};
@ChrisHSandN Sorry this does not work with Angular13.3.2 so i look at it
@jepiqueau thanks for your reply,
I am using Angular 16.2.12 (as per the tutorial package.json
setup).
Digging into this further, I suspect the issue may be with this function: https://github.com/capacitor-community/sqlite/blob/48e0c217a5ea8cfdafccc068460adc4a324e2e9a/src/web.ts#L47
Although it is async
it has an internal then()
so will resolve immediately (before anything has actually been set up).
I would propose something like:
async initWebStore(): Promise<void> {
await customElements.whenDefined('jeep-sqlite');
this.jeepSqliteElement = document.querySelector('jeep-sqlite');
// ... etc.
Otherwise await initWebStore()
doesn't actually wait for it to be ready and then checkConnectionsConsistency
gets called before the element is set up.
@ChrisHSandN You right. Will be fixed in the next release
@ChrisHSandN The tutorial has also been updated. thanks for your contribution
Describe the bug Updating the demo
ionic7-angular-sqlite-app
to v5.7.1 breaks with webpack errors andjeep-sqlite
element is not present error.To Reproduce
The app runs but fails with
Desktop (please complete the following information):
Additional context With a bit of Googling I ended up with the following changes:
package.json
tsconfig.json
angular.json
The above fixes the webpack < 5 breaking change error in compilation but still fails with
So I am a bit stuck.