!ZdVDBBouJUyQVsewKn:monero.social

Monero Community Dev

148 Members
Web4!!! Non-core dev chat. Speak to others as you would speak to your grandchildren or grandparents. 17 Servers

Load older messages


SenderMessageTime
12 Apr 2024
@woodser:monero.socialwoodser pat: you should be able to add 'web-worker' to your webpack config's externals field to exclude it: https://github.com/woodser/monero-ts/issues/181#issuecomment-1930501440 09:00:13
@woodser:monero.socialwoodserand I just added 'web-worker' to the externals field in the monero-ts project so hopefully this won't be necessary in the next release: https://github.com/woodser/monero-ts/pull/194/commits/6c8216455d1b31d80ed2c456d4d5b0ed665a0bb309:00:32
@mainnet_pat:monero.socialpat
In reply to @woodser:monero.social
pat: you should be able to add 'web-worker' to your webpack config's externals field to exclude it: https://github.com/woodser/monero-ts/issues/181#issuecomment-1930501440
thanks, I have tried this, but it gives me Module not found: Can't resolve 'critters'
09:14:43
@syntheticbird:monero.socialSyntheticBirdAccording to an attended effort to write a new community guideline repository, an issue for discussion has been opened regarding CCS: https://github.com/monero-project/monero-community-guideline/issues/2 You can commend your ideas, issues and propposals under this issue.09:30:07
@syntheticbird:monero.socialSyntheticBirdcomment*09:32:38
@woodser:monero.socialwoodser pat: hm yeah, I see the same, and npm install critters fixes it 09:36:58
@mainnet_pat:monero.socialpatI think this might be because config.externals got redefined, but not getting extended with config.externals["web-worker"] = ["web-worker"];09:37:51
@woodser:monero.socialwoodserah that could be09:39:31
@mainnet_pat:monero.socialpat

but then I still get an error:

 тип TypeError: Worker is not a constructor
    at Home (./src/app/page.tsx:19:85)
    at stringify (<anonymous>)
09:39:37
@woodser:monero.socialwoodserI have a sample project with which isn't hitting that error: https://github.com/woodser/xmr-next-app09:53:26
@woodser:monero.socialwoodser * I have a sample project which isn't hitting that error: https://github.com/woodser/xmr-next-app09:55:49
@woodser:monero.socialwoodser don't know if you need to rm -rf ./node_modules && npm install or something, but you could test and cross reference with the sample project for debugging. hopefully it's recreatable there so we can add a fix to the sample project as well 09:58:12
@mainnet_pat:monero.socialpat

so in my environment the const Worker = require("web-worker"); evaluates to a module object as seen in logs: Object [Module] { default: [Getter] }

changing to LibraryUtils.WORKER = new Worker.default(LibraryUtils.WORKER_DIST_PATH); makes it advance, but then build hangs

10:08:38
@mainnet_pat:monero.socialpat Now getting this GET /monero_web_worker.js 404 in 736ms 10:38:55
@mainnet_pat:monero.socialpathad to copy the js and wasm to public to make it work10:58:24
@mainnet_pat:monero.socialpatotherwise all is fine, I can interact with the lib10:58:54
@woodser:monero.socialwoodserI have not been able to load the wasms in a next.js app, due to the error: "Failed to parse URL from /Users/woodser/git/xmr-next-app/node_modules/monero-ts/dist/dist/monero_wallet_full.wasm"12:04:03
@woodser:monero.socialwoodserso any help you can provide to make that work would be super helpful :) sounds like you had success by copying the dist assets to the root public folder12:05:19
@woodser:monero.socialwoodserany pr to my sample app or monero-ts with fixes is more than welcome12:06:43
@woodser:monero.socialwoodser don't know if the Worker.default fix is generalized for all environments though pat 12:07:52
@mainnet_pat:monero.socialpat I have an ugly patch fix for this which just skips using fetch: isFileURI(wasmBinaryFile)&&typeof fetch=="function"&&false 12:09:40
@mainnet_pat:monero.socialpatWorker.default seemed to be a transient issue there, I have ditched next14 because it is complaining about topLevelAwait and went back to next13 which did not in other projects of mine12:10:49
@woodser:monero.socialwoodser
In reply to @mainnet_pat:monero.social
I have an ugly patch fix for this which just skips using fetch: isFileURI(wasmBinaryFile)&&typeof fetch=="function"&&false
how do you load the file then? some other manual way while the code in LibraryUtils.ts is disabled?
12:37:57
@woodser:monero.socialwoodser
In reply to @mainnet_pat:monero.social
I have an ugly patch fix for this which just skips using fetch: isFileURI(wasmBinaryFile)&&typeof fetch=="function"&&false
* how do you load the file then? this disables the loading in LibraryUtils.ts, and then you load some other way?
12:39:44
@woodser:monero.socialwoodser * how do you load the wasm then? this disables the loading in LibraryUtils.ts, and then you load another way? 12:43:02
@mainnet_pat:monero.socialpatDownload monero-ts+0.9.7.patch12:45:37
@mainnet_pat:monero.socialpatthis is the patch of the compiled file, I do not do anything else12:45:38
@woodser:monero.socialwoodserhuh, cool.12:57:46
@mainnet_pat:monero.socialpat woodser: Also, there is an alternative to loading wasms.
see https://www.npmjs.com/package/@bitauth/libauth?activeTab=code under @bitauth/libauth/build/lib/crypto/sha256.js.
it loads base64 encoded wasm from @bitauth/libauth/build/lib/bin/sha256/sha256.base64.js
16:17:06
@mainnet_pat:monero.socialpatno fetch is needed16:17:10

Show newer messages


Back to Room ListRoom Version: 9