UXP Devtools CLI - Websocket error [object Object]

Hi,

I’m trying to get the CLI version of UXP Devtools to work, however I end up with an error when trying to load a plug-in with the uxp plugin load command, se below:

I start by starting the service:

> uxp service start
UXP Developer Service now running at port 14001
New Server client Connected : Type : app
PS(23.1.0) connected to service ...

Then I run the command to enable the devtools

> uxp devtools enable

Administrator privileges are needed to enable UXP Developer Tools on this system. By continuing you agree to
1) Adobe's Terms of Use: https://www.adobe.com/legal/terms.html
2) Adobe Developer Additional Terms: http://www.adobe.com/go/developer-terms
Press Enter to Continue...


UXP DevTools is Enabled now.

However, when trying to initialize a plugin it just outputs the following:

> uxp plugin load
Websocket error [object Object]
Command 'plugin load' failed.
[object Object]

Tried with both on a new plugin initialization (running uxp plugin init) as well as this code: uxp-photoshop-plugin-samples/hello-world-panel-js-sample at main · AdobeDocs/uxp-photoshop-plugin-samples · GitHub

If I try uxp plugin validate, I get the following error:

Websocket error [object Object]
Manifest Validation Failed.
[object Object]

If I try uxp apps list to list running apps to connect to i recieve:

Websocket error [object Object]
Command 'apps list' failed.
[object Object]

Any idéas why it’s not working? I’ve installed the CLI version by cloning the repository and building via Yarn.

Running on Windows 10 Enterprise, 22H2 with Photoshop 2022 ( 23.1.0 )
It’s an enterprise environment without Creative Cloud App, so I’m unable to install the UI version of the UXP Developer Tools.

Your ‘localhost’ is resolved as IP v6 instead of v4

Find this in the devtools-cli repo:
ws://localhost:${port}/socket/cli;
Then change it to:
ws://127.0.0.1:${port}/socket/cli;

2 Likes

Marvelous! Test plug-in loads like a charm with the above fix.

If anyone stumbles upon this issue again; the main issue seems to be row 105 in devtools-cli/packages/uxp-devtools-core/src/core/client/connection/CliClientController.js

There are a few other places where localhost is referenced, might be a good idea to adjust there as well, I only adjusted the above line though, to see if I could get the application to load a test plugin, and it finally did!

This is something I never would have solved on my own, I can’t thank you enough @dongdt_pxz!

1 Like