bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9.27k stars 1.25k forks source link

Sync Command Failure #11075

Open valorisa opened 1 month ago

valorisa commented 1 month ago

Steps To Reproduce

  1. Open a terminal.

  2. Run the bw sync command :

    bw sync

  3. Observe the following deprecation warning and error in the terminal output:

Deprecation Warning

(node:11846) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:108:7)
    at Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/opt/homebrew/Cellar/bitwarden-cli/2024.8.2/libexec/lib/node_modules/@bitwarden/cli/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js:2:18)

TypeError

/opt/homebrew/Cellar/bitwarden-cli/2024.8.2/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:19572
                return Response.error("Syncing failed: " + e.toString());
                                                             ^

TypeError: Cannot read properties of null (reading 'toString')
    at SyncCommand.<anonymous> (/opt/homebrew/Cellar/bitwarden-cli/2024.8.2/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:19572:62)
    at Generator.throw (<anonymous>)
    at rejected (/opt/homebrew/Cellar/bitwarden-cli/2024.8.2/libexec/lib/node_modules/@bitwarden/cli/build/bw.js:19547:65)

Expected Behavior

The Bitwarden CLI should run without displaying deprecation warnings or errors, and the bw sync command should execute successfully.

Actual Behavior

The Bitwarden CLI runs but displays a deprecation warning for the punycode module and a TypeError that causes the bw sync command to fail.

Screenshots or Videos

Capture d’écran 2024-09-16 à 11 36 31

Additional Context

Operating System: macOS 15.0
Node.js Version: v22.8.0
Bitwarden CLI Version: 2024.8.2
Installation Method: Homebrew (`brew install bitwarden-cli`)

Additional Information

I have tried updating the Bitwarden CLI using Homebrew:

brew upgrade bitwarden-cli

However, the issues persist. I believe the deprecation warning is coming from a dependency (node-fetch) used by the Bitwarden CLI.

Possible Solutions :

  1. Update Dependencies: Ensure that all dependencies, including node-fetch, are up to date and do not rely on the deprecated punycode module.
  2. Fix Null Value: Investigate and fix the null value issue in the SyncCommand that is causing the TypeError.

Conclusion

I would appreciate it if these issues could be addressed in a future release of the Bitwarden CLI. Thank you for your attention to this matter.

Operating System

macOS

Operating System Version

ProductName : macOS ProductVersion : 15.0 BuildVersion : 24A335

Shell

Zsh

Build Version

2024.8.2

Issue Tracking Info

djsmith85 commented 1 month ago

Hi @valorisa , the first issue (punycode) has previously been reported with https://github.com/bitwarden/clients/issues/6689

valorisa commented 1 month ago

Thanks