Running the debugger on an API version 2 plugin in Photoshop[version 23.0.0] Get the following warning when creating new document via the UXP Developer tool:
It means that as you are using API2 you now have to modify your code to match the requirements for API 2
How To Get CreateDocument To Work With API 2?
Looking at the docs I think you have to use the .add
Documents (adobe.io)
I think you need this wrapper : https://www.adobe.io/photoshop/uxp/2022/ps_reference/media/executeasmodal/