The Javascript error in Google Perspective API plugin discussion revolves around a TypeError caused by calling a finally() method on an undefined function. RGJ shared the error message and code snippet, suspecting the issue lies in the function not returning anything under certain circumstances.
sam noted the function appears to be intended as an async function, which is supported, and promised to look into the issue. martin took over the investigation and later proposed a fix in the form of a GitHub pull request (https://github.com/discourse/discourse-perspective-api/pull/43) in post #13.
TypeError: Cannot read properties of undefined (reading 'finally')
at n.perspectiveSave (https://REDACTED/assets/plugins/discourse-perspective-api-12d54e93711215e76c0e9e41ddcbaff5276b541b4db8c82f8731e6544a60b4c6.js:1:1041)
which seems to come from calling a finally() method while the function before that in the chain is not returning anything under various circumstances (there are three return statements without arguments in the code).
I am not familiar enough with this specific logic to figure out what should be returned in these places.