-
-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't resolve './rust-crypto' in '<project dir>/node_modules/matrix-js-sdk/lib' with webpack #4392
Comments
Looks like this might need an additional CC @richvdh. |
Ah, small wonder. The node example doesn't use encryption. 🤦♂️ |
Looks like |
@Harm-van-Stekelenburg, I have run into the same problem in the node esm environment and opened a PR to fix it: #4445 I have been adding the following command to my Dockerfile to fix it after building - perhaps you can do something similar for now. sed -i 's|import("\./rust-crypto")|import("\./rust-crypto/index.js")|' ./node_modules/matrix-js-sdk/lib/client.js |
I've updated the title to focus this issue on the first problem in the original description. Please open another issue for the second problem, if it's still a thing (the link no longer goes to a line that references |
I can't get the latest release candidate to work with webpack. Now I'm not a javascript expert so this could very well be me overlooking something basic.
I made a small project to reproduce the issue: https://github.com/Harm-van-Stekelenburg/import_webpack__matrix_js
I run into two problems with this project:
npm run serve
I get the error:./node_modules/matrix-js-sdk/lib/client.js
it will build but I get the following error in the browser console:I think that means the global here: https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/matrix.ts#L133
I get neither error on version 34.3.1.
I can fix the second problem with the webpack define plugin to redefine global to something like
window
but that seems a bit unnecessary.The text was updated successfully, but these errors were encountered: