SyntaxError: Failed to execute 'querySelector' on 'Element' #7518

Open
opened 2026-02-16 18:07:26 -05:00 by yindo · 1 comment
Owner

Originally created by @ZhangzrJerry on GitHub (Jan 25, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Description

SyntaxError: Failed to execute 'querySelector' on 'Element': '[data-key=""20 Projects/26Sep \345\215\232\346\231\272\346\236\227\345\256\236\344\271\240/README.md""]' is not a valid selector.
at http://tauri.localhost/assets/index-180x8UwN.js:1786:162977
at http://tauri.localhost/assets/index-180x8UwN.js:2:5371
at untrack (http://tauri.localhost/assets/index-180x8UwN.js:2:5149)
at Object.fn (http://tauri.localhost/assets/index-180x8UwN.js:2:5364)
at runComputation (http://tauri.localhost/assets/index-180x8UwN.js:2:8250)
at updateComputation (http://tauri.localhost/assets/index-180x8UwN.js:2:7981)
at runTop (http://tauri.localhost/assets/index-180x8UwN.js:2:9466)
at runUserEffects (http://tauri.localhost/assets/index-180x8UwN.js:2:10730)
at http://tauri.localhost/assets/index-180x8UwN.js:2:10322
at runUpdates (http://tauri.localhost/assets/index-180x8UwN.js:2:9655)

Plugins

No

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

No response

Originally created by @ZhangzrJerry on GitHub (Jan 25, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Description SyntaxError: Failed to execute 'querySelector' on 'Element': '[data-key=""20 Projects/26Sep \345\215\232\346\231\272\346\236\227\345\256\236\344\271\240/README.md""]' is not a valid selector. at http://tauri.localhost/assets/index-180x8UwN.js:1786:162977 at http://tauri.localhost/assets/index-180x8UwN.js:2:5371 at untrack (http://tauri.localhost/assets/index-180x8UwN.js:2:5149) at Object.fn (http://tauri.localhost/assets/index-180x8UwN.js:2:5364) at runComputation (http://tauri.localhost/assets/index-180x8UwN.js:2:8250) at updateComputation (http://tauri.localhost/assets/index-180x8UwN.js:2:7981) at runTop (http://tauri.localhost/assets/index-180x8UwN.js:2:9466) at runUserEffects (http://tauri.localhost/assets/index-180x8UwN.js:2:10730) at http://tauri.localhost/assets/index-180x8UwN.js:2:10322 at runUpdates (http://tauri.localhost/assets/index-180x8UwN.js:2:9655) ### Plugins No ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal _No response_
yindo added the bugweb labels 2026-02-16 18:07:26 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9173: SyntaxError: CSS selector not properly escaped for file paths with special characters
  • #9330: data-key="file^" is not a valid selector
  • #8172: OpenCode 桌面版 不支持读取中文名文件

All of these issues report the same root cause: unescaped file paths in CSS selectors when the path contains special characters (particularly non-ASCII characters like Chinese). The suggested fix involves using CSS.escape() when building selectors.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of existing issues. Please check: - #9173: SyntaxError: CSS selector not properly escaped for file paths with special characters - #9330: data-key="file^" is not a valid selector - #8172: OpenCode 桌面版 不支持读取中文名文件 All of these issues report the same root cause: unescaped file paths in CSS selectors when the path contains special characters (particularly non-ASCII characters like Chinese). The suggested fix involves using `CSS.escape()` when building selectors. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7518