Sender | Message | Time |
---|---|---|
12 Apr 2024 | ||
woodser | 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 | and 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/6c8216455d1b31d80ed2c456d4d5b0ed665a0bb3 | 09:00:32 |
pat | In reply to @woodser:monero.socialthanks, I have tried this, but it gives me Module not found: Can't resolve 'critters' | 09:14:43 |
SyntheticBird | According 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 | comment* | 09:32:38 |
woodser | pat: hm yeah, I see the same, and npm install critters fixes it | 09:36:58 |
pat | I think this might be because config.externals got redefined, but not getting extended with config.externals["web-worker"] = ["web-worker"]; | 09:37:51 |
woodser | ah that could be | 09:39:31 |
pat | but then I still get an error:
| 09:39:37 |
woodser | I have a sample project with which isn't hitting that error: https://github.com/woodser/xmr-next-app | 09:53:26 |
woodser | * I have a sample project which isn't hitting that error: https://github.com/woodser/xmr-next-app | 09:55:49 |
woodser | 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 |
pat | so in my environment the changing to | 10:08:38 |
pat | Now getting this GET /monero_web_worker.js 404 in 736ms | 10:38:55 |
pat | had to copy the js and wasm to public to make it work | 10:58:24 |
pat | otherwise all is fine, I can interact with the lib | 10:58:54 |
woodser | I 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 | so 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 folder | 12:05:19 |
woodser | any pr to my sample app or monero-ts with fixes is more than welcome | 12:06:43 |
woodser | don't know if the Worker.default fix is generalized for all environments though pat | 12:07:52 |
pat | I have an ugly patch fix for this which just skips using fetch: isFileURI(wasmBinaryFile)&&typeof fetch=="function"&&false | 12:09:40 |
pat | Worker.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 mine | 12:10:49 |
woodser | In reply to @mainnet_pat:monero.socialhow do you load the file then? some other manual way while the code in LibraryUtils.ts is disabled? | 12:37:57 |
woodser | In reply to @mainnet_pat:monero.social* 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 | * how do you load the wasm then? this disables the loading in LibraryUtils.ts, and then you load another way? | 12:43:02 |
pat | Download monero-ts+0.9.7.patch | 12:45:37 |
pat | this is the patch of the compiled file, I do not do anything else | 12:45:38 |
woodser | huh, cool. | 12:57:46 |
pat | 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 |
pat | no fetch is needed | 16:17:10 |