Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script editor cannot open some scripts #3083

Open
JustinGeorgi opened this issue Mar 1, 2025 · 0 comments
Open

Script editor cannot open some scripts #3083

JustinGeorgi opened this issue Mar 1, 2025 · 0 comments
Labels
bug Something isn't working main ui Main UI

Comments

@JustinGeorgi
Copy link
Contributor

JustinGeorgi commented Mar 1, 2025

This appears to be a regression from #3051. When attempting to open some of my scripts in the script editor, OH crashes (tab must be killed). The console reports

app.a6445ca….js:2 TypeError: Cannot read properties of undefined (reading 'documentationLink')

This only impacts JSscripting scripts, I have not noticed with other languages. In fact, it only impacts older JSscripting scripts. It appears that the new type for JSScripting is just application/javascript, however, many of my scripts are old enough to have started as Nashorn and be upgraded over time. Those scripts that were upgraded from Nashorn have a type of application/javascript;version=ECMAScript-2021. This is not recognized by the new documentation link system.

This isn't a difficult fix, but there are a couple of different ways to do it so I thought a discussion might be worthwhile. Obviously, application/javascript;version=ECMAScript-2021 can just be added to automation-languages.js. My question is whether it makes more sense to just add this as one of the options, or to intercept these older types and automatically update the type to the newer version.

Anyone have an opinion on this?

@JustinGeorgi JustinGeorgi added bug Something isn't working main ui Main UI labels Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

No branches or pull requests

1 participant