powersync-js icon indicating copy to clipboard operation
powersync-js copied to clipboard

react-native-web copy-assets filename mismatch

Open jasonlewicki opened this issue 10 months ago • 2 comments

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?): Image

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.

jasonlewicki avatar Mar 21 '25 06:03 jasonlewicki

Thank you for raising this @jasonlewicki! Will try to get some to the bottom of this early next week.

Chriztiaan avatar Mar 21 '25 08:03 Chriztiaan

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 :)

Chriztiaan avatar Apr 07 '25 09:04 Chriztiaan

The two PRs mentioned have been merged.

michaelbarnes avatar May 29 '25 20:05 michaelbarnes