-
Notifications
You must be signed in to change notification settings - Fork 307
Closed
Labels
Description
In order to build the example for expo web, a couple changes might be required:
a) should use metro for the web bundler:
"web": {
"favicon": "./assets/favicon.png",
"bundler": "metro",
"output": "static",
},
b) resolve .mjs files in metro.config.js (Zod requires it)
config.resolver.sourceExts.push('mjs');
c) NativeModules.SourceCode.scriptURL isn't cross-platform, therefore you might need to explicitly define the hostname / url through an env variable or find a cross platform method, perhaps in expo constants.
electric/examples/expo/src/config.ts
Line 2 in 4682c4a
| const { hostname } = new URL(NativeModules.SourceCode.scriptURL) |
Unfortunately, web still errors with a require cycles:
Require cycle: ../../node_modules/electric-sql/dist/migrators/index.js -> ../../node_modules/electric-sql/dist/migrators/bundle.js -> ../../node_modules/electric-sql/dist/migrators/index.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
Require cycle: ../../node_modules/sqlite-parser/lib/index.js -> ../../node_modules/sqlite-parser/lib/streaming.js -> ../../node_modules/sqlite-parser/lib/index.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
Require cycle: ../../node_modules/protobufjs/src/util/minimal.js -> ../../node_modules/protobufjs/src/util/longbits.js -> ../../node_modules/protobufjs/src/util/minimal.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
Require cycle: ../../node_modules/electric-sql/dist/satellite/client.js -> ../../node_modules/electric-sql/dist/satellite/shapes/cache.js -> ../../node_modules/electric-sql/dist/satellite/client.js
Reactions are currently unavailable