Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Bug: "Cannot read properties of undefined (reading 'val')" Rule 'require-v-for-key' #143

Open
juakotorres opened this issue Jan 12, 2022 · 4 comments · Fixed by #144
Open
Labels
bug Something isn't working

Comments

@juakotorres
Copy link
Contributor

juakotorres commented Jan 12, 2022

Info

Tool Version
Plugin v1.0.0-alpha.20
Eslint v8.3.0
Node v16.13.1
OS win

Eslint config

{
  extends: [
    // Base ESLint recommended rules
    'eslint:recommended',
    
    // ESLint typescript rules
    // See https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    
    // See https://github.com/vuejs/eslint-plugin-vue
    'plugin:vue/recommended',

    // See https://github.com/import-js/eslint-plugin-import
    'plugin:import/recommended'
    
    'plugin:vue-pug-sfc/recommended',
  ]
}

Input

1 <template lang="pug">
2 .audio-bars.row.items-center.no-wrap(v-on="$listeners")
3   .bar.inline-block.no-pointer-events(
4     v-for="(value, index) in values"
5     :style="barStyle(value, index)"
6   )
7  slot
8 </template>
9
10 <script lang="ts">
11 import Vue from 'vue';

Output or Error

Cannot read properties of undefined (reading 'val')                                                             
Occurred while linting <FileDirectory>:11
Rule: "vue-pug-sfc/this-in-template"

Expected Output

No Error, but the eslint error for require-v-for-key

Additional Context

First of all thanks for the amazing work!. This will helps us write Pug templates :D.

In regards to the bug, I found files that had the require-v-for-key rule in effect and works correctly. Only on this file it throws the undefined error. I also checked the rules one by one (because it says the error is on this-in-template) and the rule 'require-v-for-key' was the one throwing the error.

If the key is added to the file correctly there are no errors and all works perfectly. So i think its an error of the rule. Can you check what may be causing this error?

@Shinigami92 Shinigami92 added the bug Something isn't working label Jan 12, 2022
@Shinigami92
Copy link
Owner

Shinigami92 commented Jan 12, 2022

Currently I'm hardly busy in another project, so I may have not time for a week or two
But I can review stuff 🙂 if you are happy to open a PR

@juakotorres
Copy link
Contributor Author

I think I resolved this issue on this PR -> #144.

@Shinigami92 Shinigami92 linked a pull request Jan 16, 2022 that will close this issue
@Shinigami92
Copy link
Owner

Is this urgent to be released for you? Or can I wait until we have some more stuff?

@juakotorres
Copy link
Contributor Author

It's not urgent, can wait for more changes.

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

Successfully merging a pull request may close this issue.

2 participants