theme-check icon indicating copy to clipboard operation
theme-check copied to clipboard

Languageserver Crashes - VSCode WSL2 Win11

Open ChristopherCapito opened this issue 1 year ago • 2 comments

Describe the bug The language server crashes after going through the theme files.

Expected I expecte the check to suceed or fail, but not to crash without a result.

Actual The languagserver goes through all files, on the last one (locales/en.default.json) it crashes.

Stack trace

Checking . ...
Exception while running `NestedSnippet#on_end`:
Timeout::Error: execution expired
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/offense.rb:33:in `initialize'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/check.rb:96:in `new'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/check.rb:96:in `add_offense'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:42:in `block (2 levels) in on_end'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block (2 levels) in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block (2 levels) in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block (2 levels) in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:13:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:41:in `block in on_end'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:40:in `each_pair'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:40:in `on_end'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:42:in `block in call_check_method'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:189:in `block in timeout'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:36:in `block in catch'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:36:in `catch'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:36:in `catch'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:198:in `timeout'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:41:in `call_check_method'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:11:in `block in call'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:10:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:10:in `call'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/analyzer.rb:170:in `finish'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/analyzer.rb:64:in `analyze_theme'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:191:in `check'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:123:in `run!'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:127:in `run'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:149:in `parse_and_run'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/exe/theme-check:6:in `<top (required)>'
  /home/cdev/.rbenv/versions/3.2.1/bin/theme-check:25:in `load'
  /home/cdev/.rbenv/versions/3.2.1/bin/theme-check:25:in `<main>'

Theme File: ? Node: ? Markup:


Line number: ? Check options: {:max_nesting_level=>3} Theme Check Version: 1.14.0 Ruby Version: 3.2.1 Platform: x86_64-linux Muffin mode: activated


**Debugging information**
- OS [Windows 11, WSL2]
- Version 1.14.0

**Additional context**
The same error occurs with the VSCode Shopify Liquid extension.

ChristopherCapito avatar Mar 04 '23 00:03 ChristopherCapito

I'm also encountering the same issue

Taichi-S avatar Jul 12 '23 07:07 Taichi-S

@ChristopherCapito I'm not sure how it works, but I was able to run it without any bugs

Here is what I did:

  1. init .theme-check.yml
theme-check --init
  1. change mac_nesting_level of NestedSnippet to 1 in .theme-check.yml (default value was 3. when it is 2, other warning happened)
NestedSnippet:
  enabled: true
  ignore: []
  max_nesting_level: 1
  1. run theme-check using the .theme-check.yml
theme-check -C .theme-check.yml

Taichi-S avatar Jul 12 '23 08:07 Taichi-S

👋🏻 Hi @ChristopherCapito! Thanks for reporting this. Unfortunately the Ruby version of theme check has been deprecated for some time. Would you be able to confirm you are still having issues when using our maintained version of theme check? This is done using either the latest version of the Shopify CLI, or via the Shopify Liquid Visual Studio Code extension.

If you are still having issues, please raise an issue over in the CLI or theme tools repositories. Thanks!

lukeh-shopify avatar Jul 12 '24 23:07 lukeh-shopify