adobe-uxp / devtools-cli

CLI for UXP developer tools, including creating, loading and debugging plugins.
Apache License 2.0
22 stars 6 forks source link

UXP Plugin Load: Websocket error [object Object] #11

Open mountaintwig opened 7 months ago

mountaintwig commented 7 months ago

Hi,

I'm unable to get this tool to work when loading a plug in.

It seems to work fine when starting the service

> uxp service start
UXP Developer Service now running at port 14001

Then enabling the dev-tools

> 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.

But 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: https://github.com/AdobeDocs/uxp-photoshop-plugin-samples/tree/main/hello-world-panel-js-sample

Any idéas why it's not working?

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.

ErinFinnegan commented 7 months ago

Hi there!

You might want to ask this in the UXP forum if you haven't already: https://forums.creativeclouddeveloper.com/c/uxp-developer-tool/65 If we don't have a tag yet for the command line tool please add a tag...

It's an enterprise environment without Creative Cloud App, so I'm unable to install the UI version of the UXP Developer Tools.

I think you should be able to install it if you ask your Admin to create an installer or to install it for you (I'm double checking this). Finding your admin can be tricky: https://helpx.adobe.com/enterprise/kb/contact-administrator.html (A very strict admin might tell you "no"... but if you're building something for the company, hopefully they would approve!)

ErinFinnegan commented 7 months ago

I checked, and apparently UDT is not yet available in the Admin Console after all... although it will be eventually, work is underway. Sorry about that...

mountaintwig commented 7 months ago

No worries, thank you for double checking anyhow.

I had actually tasked our Admin to verify that UDT was still not available in the Console before trying out this CLI version, you managed to get me the answer first though!

I'll try posting the same question in the UXP forum; hopefully someone there have managed to get things set up correctly.

mountaintwig commented 3 months ago

This issue was resolved in the Adobe Developer Forums: https://forums.creativeclouddeveloper.com/t/uxp-devtools-cli-websocket-error-object-object/7528

The issue seems to be that localhost is resovled as an IPv6 adress instead of IPv4, and changing line 105 in devtools-cli/packages/uxp-devtools-core/src/core/client/connection/CliClientController.js from const url = `ws://localhost:${port}/socket/cli`; to const url = `ws://127.0.0.1:${port}/socket/cli`; seems to have resolve the error.

Also, see this fork where the fix (among others) is already pulled into the source: https://github.com/bubblydoo/devtools-cli