Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

NoMethodError: undefined method `key?' for "Quantity":String #620

Closed
vfonic opened this issue May 30, 2022 · 3 comments
Closed

NoMethodError: undefined method `key?' for "Quantity":String #620

vfonic opened this issue May 30, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@vfonic
Copy link

vfonic commented May 30, 2022

Successfully installed ast-2.4.2
Successfully installed parser-3.1.2.0
Successfully installed liquid-5.3.0
Successfully installed theme-check-1.[10](https://github.com/<redacted>/runs/6651782031?check_suite_focus=true#step:4:11).2
4 gems installed
$ theme-check --version
1.10.2
$ theme-check --fail-level style -o json .
Checking . ...
Exception while running `TranslationKeyExists#on_end`:

NoMethodError: undefined method `key?' for "Quantity":String
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:51:in `block in key_exists?'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:50:in `each'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:50:in `key_exists?'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:35:in `block (2 levels) in on_end'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:32:in `each'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:32:in `block in on_end'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:31:in `each_pair'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks/translation_key_exists.rb:31:in `on_end'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks.rb:42:in `block in call_check_method'
  /usr/lib/ruby/3.0.0/timeout.rb:97:in `block in timeout'
  /usr/lib/ruby/3.0.0/timeout.rb:35:in `block in catch'
  /usr/lib/ruby/3.0.0/timeout.rb:35:in `catch'
  /usr/lib/ruby/3.0.0/timeout.rb:35:in `catch'
  /usr/lib/ruby/3.0.0/timeout.rb:[11](https://github.com/<redacted>/runs/6651782031?check_suite_focus=true#step:4:12)2:in `timeout'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks.rb:41:in `call_check_method'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks.rb:11:in `block in call'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks.rb:10:in `each'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/checks.rb:10:in `call'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/analyzer.rb:153:in `finish'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/analyzer.rb:63:in `analyze_theme'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/cli.rb:191:in `check'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/cli.rb:[12](https://github.com/<redacted>/runs/6651782031?check_suite_focus=true#step:4:13)3:in `run!'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/cli.rb:127:in `run'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/lib/theme_check/cli.rb:[14](https://github.com/<redacted>/runs/6651782031?check_suite_focus=true#step:4:15)9:in `parse_and_run'
  /usr/lib/ruby/gems/3.0.0/gems/theme-check-1.10.2/exe/theme-check:6:in `<top (required)>'
  /github/home/bin/theme-check:25:in `load'
  /github/home/bin/theme-check:25:in `<main>'


Theme File: `?`
Node: `?`
Markup:

Line number: ?
Check options: `{}
`
Theme Check Version: 1.10.2
Ruby Version: 3.0.3
Platform: x86_64-linux-musl
Muffin mode: activated

------------------------
Whoops! It looks like you found a bug in Theme Check.
Please report it at https://github.com/Shopify/theme-check/issues, and include the message above.
Or cross your fingers real hard, and try again.
$ git fetch origin master
From https://github.com/<redacted>
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
$ git diff --name-only --diff-filter=ACMRTUB origin/master
Creating GitHub check...
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /index.js:69:27
    at async /index.js:67:[20](https://github.com/<redacted>/runs/6651782031?check_suite_focus=true#step:4:21)
Error: Unexpected end of JSON input

Let me know if there's anything else I need to provide.

@vfonic
Copy link
Author

vfonic commented May 30, 2022

This was the first run (and all consecutive runs) for this GH Action:

name: Theme Check
on: [push]
jobs:
  theme-check:
    name: Theme Check
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

      - name: Theme Check
        uses: shopify/theme-check-action@v1
        with:
          theme_root: '.'
          flags: '--fail-level style'
          token: ${{ github.token }}
          base: master

@charlespwd
Copy link
Contributor

That's actually a theme-check bug I need to fix 🙈. @shopify/prettier-plugin-liquid is finally out of the door. I'll have time to do a round of bug fixes. I believe this has already been reported.

@charlespwd charlespwd transferred this issue from Shopify/theme-check-action Jul 25, 2022
@charlespwd charlespwd added the bug Something isn't working label Jul 25, 2022
@lukeh-shopify
Copy link
Contributor

👋🏻 Hi @vfonic! 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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants