Shouldn’t changes in the CSS file be updated if “Watch” is enabled in the UXP developing tool? As far as I remember it worked when I last worked on my plugin.
Has anybody got some insight on this?
Just tried it here on Mac and Windows and CSS changes are working as expected
I suspect the only file that is not watched, is manifest itself and if that changes, even reload doesn’t help. At least I always had to unload-load. Otherwise didn’t have much issues lately
No luck for me updating my CSS file. I always have to reload the plugin for the CSS changes to show up. Tried it both in Photoshop 2021 and 2022. As far as I remember there was an UXP update since I last worked on my plugin. It might have to do something with that. As I remember, it worked before.
In Photoshop 2022 I also get this message when debugging. Might it have anything to do with that?
“Plugin is using a deprecated apiVersion of 1. Please update the plugin to apiVersion 2”
The API Level version shouldn’t have anything to do with this.
It’s worth taking a look at how you’ve loaded the plugin in UDT, and where your source files are in relation. For example, if you’ve added the plugin’s distribution folder (if you’re using React, say), editing a CSS file in a src folder that’s a sibling of that distribution folder wouldn’t trigger a reload (unless you also have a watcher that rebuilds your React plugin on changes.)
If you’ve got a vanilla plugin, you should see a reload when you change CSS, JS(X), or HTML files – if you’re not seeing this behavior, it would be good to learn more about your system configuration and what kinds of volumes you’re storing files on (is it over the network, for example?).
I don’t use React, just HTML, Javascript and CSS files. I also haven’t got the files on a network drive. It’s a physical hard disk. I just go to “Add existing plugin”, choose the manifest file, load the plugin and also select “Watch”. When I edit something in the CSS file (located in the root folder at the same level as the manifest file) and save it, nothing happens to the plugin in Photoshop. Only when I reload the plugin manually, the CSS changes are visible.
I just tried if changing the HTML file works - it isn’t updated either. Again only reloading the plugin works.
I’m pretty sure it worked (same PC) when I last worked on the plugin (before the UXP update and PS 2021 back then).
Took a look in the source, and we watch js(x)
, ts(x)
, html
, and (s)css
files using the /**/*.{ext}
glob. We use chokidar for the watching, and don’t use polling or FsEvents. We’ll ignore all **/node_modules/**
files.
Further questions:
- Can you check the App Logs (in UDT 1.4)? Anything logged there?
- What OS are you using?
- What file path are you using? Wondering if there could be something in the path that
chokidar
is breaking on? - What editor are you using? Shouldn’t matter, but trying to rule things out.
Also adding @Sujai here (UDT EM) since he might be able to get someone on the team to take a look next week (this week is holiday in India)
Hey.
I think that I found the culprit. It seems to have to do with the path name - probably having issues with brackets “(” and “)”.
This path doesn’t work … E:\Graphic\Photoshop Stuff\UXP\Web Sharpener V2.0.0\Edit_V3 (2.0.2)
This one does … E:\Graphic\Photoshop Stuff\UXP\Web Sharpener V2.0.0\Edit_V4
OS is Windows 10 64-Bit
Maybe worth fixing - brackets aren’t that unusual to use in path names.
IMHO, no one should use brackets or spaces in path names for their development. Only alphanumerics, dashes, underscores and periods. That’s it. Even some Windows apps can’t properly handle brackets and I won’t even expand on UTF-8 symbols I’ve been in similar situations so many times (sometimes even because of a space in path) so I stopped using other characters years ago and didn’t have any related issues since.
I always use simple relative paths within a project. But for the container path there shouldn’t be an issue with any names.
I think it’s the periods. See Watching directory with "." in the name · Issue #1019 · paulmillr/chokidar · GitHub. The issue is open on that end, hence why you’re seeing the issue.
OK. Not a huge issue, but a fix would be nice.