Developer Tools not working

Hi I keep getting “SyntaxError: Identifier ‘batchPlay’ has already been declared”
So I made a small test plugin to try to fine where it’s hiding
I uninstalled & re-install Photoshop & UXP Developer Tools
I still get the same results and can’t develop plugins
If someone can help, it would be greatly appreciated

const batchPlay = require("photoshop").action.batchPlay;
const app = require('photoshop').app;
const UXP = require("uxp");
const fs = require('fs');
const fs1 = require("uxp").storage.localFileSystem;
const exeModal = require('photoshop').core.executeAsModal;

 function init () {
if(app.activeDocument==null){return;}

doc = app.activeDocument;
docPath = doc.path;

}

// ##############################################################################

const fn13 = async () => {

showAlert("Hello World");

}

document.getElementById("btn13").addEventListener("click", function () { fn13 ()});

init();


VM10 index.js:1 Uncaught SyntaxError: Identifier 'batchPlay' has already been declared
    at e.exports.execScript (uxp://uxp-internal/domjs_scripts.js:2)
    at l (uxp://uxp-internal/domjs_scripts.js:2)
    at uxp://uxp-internal/domjs_scripts.js:2
    at o._executeCallbacks (uxp://uxp-internal/domjs_scripts.js:2)
    at o._executeIfReady (uxp://uxp-internal/domjs_scripts.js:2)
    at Array.<anonymous> (uxp://uxp-internal/domjs_scripts.js:2)
    at o._executeCallbacks (uxp://uxp-internal/domjs_scripts.js:2)
    at o._executeIfReady (uxp://uxp-internal/domjs_scripts.js:2)
    at Array.<anonymous> (uxp://uxp-internal/domjs_scripts.js:2)
    at o._executeCallbacks (uxp://uxp-internal/domjs_scripts.js:2)
		
		
		
1 Like

Doesn’t look like that’s all the code you’re using. Could you maybe try searching all your project for const batchPlay string?

1 Like

Thank you so much. You were of great help, made me think.
I striped the project to it’s bear minimum and found that I made a newbie mistake: I included the index.js twice in the index.html

1 Like

Happens to all of us :wink: .

Thank you for posting the solution, though. In too many forums, many users would just post “I’ve solved it” without any further explanation or even delete the topic, so thank you for elaborating on what the issue was, since it might help others in the future :slightly_smiling_face: