signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.63k stars 421 forks source link

Unable to use @signalapp/libsignal-client #598

Open AlwarG opened 1 day ago

AlwarG commented 1 day ago

I am currently using libsignal-protocol-javascript in my Vue.js project. When I try to migrate to @signalapp/libsignal-client, I encounter the following error:

import * as libsignal from "@signalapp/libsignal-client";

The error message is:

 ERROR  Failed to compile with 1 error                                                                      

 error  in node:buffer

Syntax Error: Reading from "node:buffer" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

Is this error message expected, and how can I resolve it?

node version: 18.20.4 Vue version: 3.2.0

jrose-signal commented 16 hours ago

We regularly update the version of Node we test against to match Signal-Desktop; currently we're on 20.11.1, but Desktop is already up to 20.18.0. That doesn't mean earlier versions can't work, but in this case I think the node: syntax was added in Node 20. We'd probably take a PR to remove it for the time being, but eventually we will be using APIs that are only available in Node 20, and you'll have to update. (On the other hand, if you're okay with updating, you could just do that sooner rather than later!)

AlwarG commented 5 hours ago

If I understand correctly, instead of using libsignal-protocol-javascript, I should be using @signalapp/libsignal-client for my web application built with the Vue.js framework, rather than for a desktop application. Please let me know if this understanding is incorrect.

As per your suggestion, @jrose-signal, I updated my Node.js version to 20 and re-ran the code, but I am still encountering the same error. Could you kindly advise on how to proceed?