react-native-web copy-assets filename mismatch
Hey team,
I upgraded powersync and started receiving this error on production (dev is fine for some reason, perhaps because node_modules is not available?):
I logged in the worker which require was not working (files like this are being asked to be loaded):
../../node_modules/comlink/dist/esm/comlink.mjs
./node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js
this one was undefined:
./node_modules/@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs
my copy files from node_modules/@powersync/web/dist had these brought over:
apps/client/public/@powersync/worker/node_modules_bson_lib_bson_mjs.umd.js
apps/client/public/@powersync/worker/node_modules_bson_lib_bson_mjs.umd.js.map
apps/client/public/@powersync/worker/node_modules_crypto-browserify_index_js.umd.js
apps/client/public/@powersync/worker/node_modules_crypto-browserify_index_js.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js.map
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js.map
apps/client/public/@powersync/worker/SharedSyncImplementation.umd.js
apps/client/public/@powersync/worker/SharedSyncImplementation.umd.js.map
apps/client/public/@powersync/worker/WASQLiteDB.umd.js
apps/client/public/@powersync/worker/WASQLiteDB.umd.js.map
apps/client/public/@powersync/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js-_powersync_co-780aa20.index.umd.js
apps/client/public/@powersync/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js-_powersync_co-780aa20.index.umd.js.map
apps/client/public/@powersync/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js-_powersync_co-780aa21.index.umd.js
apps/client/public/@powersync/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js-_powersync_co-780aa21.index.umd.js.map
Copying and renaming these files :
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map
to
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.js
apps/client/public/@powersync/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.js.map
got everything working again.
I'm not sure what the underlying issue is, took me a while to figure this one out, just raising it with the team.
Thank you for raising this @jasonlewicki! Will try to get some to the bottom of this early next week.
Hey @jasonlewicki, I have been unable to reproduce this issue myself recently. Would be interesting to see a minimal reproducible example of this. I'd like to ask you to retest this against our latest versions after https://github.com/powersync-ja/powersync-js/pull/560 and https://github.com/powersync-ja/powersync-js/pull/561 are merged. I will ping you when the time comes :)
The two PRs mentioned have been merged.