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

SyntaxError at src/editors/cleanup/control-blocks-container.js #1145

Closed
juancho0202 opened this issue Jan 25, 2023 · 2 comments · Fixed by #1146
Closed

SyntaxError at src/editors/cleanup/control-blocks-container.js #1145

juancho0202 opened this issue Jan 25, 2023 · 2 comments · Fixed by #1146
Assignees
Labels
Kind: Bug Something isn't working

Comments

@juancho0202
Copy link
Contributor

Describe the bug
The clean up plugin seems to struggle with some particular LN selectors. The following stack trace was caught by Elastic monitoring:

Unhandled promise rejection: SyntaxError: Failed to execute 'querySelector' on 'Element': 'DataSet[name=Relay_FIELDAApplication/LLN0$BR$A_BRCB_23]' is not a valid selector.
at <anonymous> (src/editors/cleanup/control-blocks-container.js:181:36)
at renderUnreferencedControls (src/editors/cleanup/control-blocks-container.js:178:129)
at render (src/editors/cleanup/control-blocks-container.js:224:36)
at update (_snowpack/pkg/common/lit-element-d8235cfe.js:1749:37)
at performUpdate (_snowpack/pkg/common/lit-element-d8235cfe.js:951:22)
at _enqueueUpdate (_snowpack/pkg/common/lit-element-d8235cfe.js:904:29)
@juancho0202 juancho0202 added the Kind: Bug Something isn't working label Jan 25, 2023
@juancho0202
Copy link
Contributor Author

Unfortunately the monitoring tool doesn't catch the particular SCL file that was being used by the user at the time the error was thrown so it may be tricky to reproduce.

@danyill
Copy link
Collaborator

danyill commented Jan 25, 2023

Sheriff Juan 🤠 adds crimes to my rap sheet using new monitoring technologies!

It's almost certainly caused by a mistake I've seen before -- no quotes in the selector for the inserted string.

const isReferenced = parent?.querySelector(`DataSet[name=${name}]`);

should be instead:

const isReferenced = parent?.querySelector(`DataSet[name="${name}"]`);

I'll do a PR for this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Bug Something isn't working
Projects
None yet
2 participants