Error In Console (Manifest 5)

Since moving over to Manifest 5, I am seeing this error in the console but unable to see where its coming from.

Any clues on this one @kerrishotts please

Uncaught UxpRuntimeError: Refusing to load event handler tag as executable code. Code generation is disabled in plugins.
   at Object.logInternalUncaughtException (uxp://uxp-internal/runtime_scripts_loader.js:2)
   at e.exports.didChangeAttributeForElement (uxp://uxp-internal/domjs_scripts.js:2)
   at e.exports.didChangeAttributeForElement (uxp://uxp-internal/domjs_scripts.js:2)
   at didChangeAttribute (uxp://uxp-internal/domjs_scripts.js:2)
   at a.set value [as value] (uxp://uxp-internal/domjs_scripts.js:2)
   at a.set nodeValue [as nodeValue] (uxp://uxp-internal/domjs_scripts.js:2)
   at e.exports.setAttribute (uxp://uxp-internal/domjs_scripts.js:2)
   at Object.createElement (uxp://uxp-internal/domjs_scripts.js:2)
   at e.exports._insertElement (uxp://uxp-internal/domjs_scripts.js:2)
   at xe (uxp://uxp-internal/domjs_scripts.js:2)

Use addEventListener or assign onevent (e.g., onclick, onpointermove) handlers via code instead of inline event handlers.

Instead of:

<sp-button onclick="goDoSomething()">Go do something</sp-button>



<sp-button id="btnGoDoSomething">Go do something</sp-button>


document.querySelector("#btnGoDoSomething").onclick=() => goDoSomething();

Any on% handler in HTML code will raise the issue, so you’ll need to do an audit through your HTML code to for any on% handlers.

If it’s still happening… we may need to investigate further – in which case, you could send a bundle via DM.

I will audit the HTML @kerrishotts just for your information, the Kitchen Sink also shows the same error

Good to know; it shouldn’t.

Are you using public build or beta build of Ps?

(wondering if it’s actually an internal error that you’re seeing because the beta build has more logging turned on.)

I am using the public build 23.31

I am just about to install the Beta to see if happens on there

Yes its still the same on the beta

I’m on 23.3.1 using inline onclick but it doesn’t raise the error :thinking:

@Michel77 are you using Manifest 5 ?

Yes i am using the same definitions as you are. I’m developing on M1 Mac. Did not try on Windows.

I have found the problem which was causing it.
I had some button code in index.html that was trying to close an sp-dialog but @kerrishotts mentioned that its no longer allowed in V5.

The code was collapsed in VS Code so I missed it the first go round :slight_smile: