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

Bug: Cannot read properties of undefined (reading 'getAllComments') #17167

Closed
1 task done
dahiro opened this issue May 8, 2023 · 6 comments
Closed
1 task done

Bug: Cannot read properties of undefined (reading 'getAllComments') #17167

dahiro opened this issue May 8, 2023 · 6 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly needs info Not enough information has been provided to triage this issue repro:needed

Comments

@dahiro
Copy link

dahiro commented May 8, 2023

Environment

Node version: v18.12.1
npm version: 8.19.2
Local ESLint version: 8.40.0
Global ESLint version: -
Operating System: macOS 13.3.1 (a) (22E772610a)

What parser are you using?

Default (Espree)

What did you do?

Configuration
const defaults = require("@internal/tools/eslint-strict.config.cjs");

module.exports = {
    ...defaults,
    extends: [...defaults.extends, "plugin:@next/next/recommended", "next/core-web-vitals", "next"],
    rules: {
        ...defaults.rules,
        "import/no-default-export": "off",
        "import/no-extraneous-dependencies": "off",
        // TODO: Missing return type on function - for exported functions
        "@typescript-eslint/explicit-module-boundary-types": "off",
    },
};
some ts files

What did you expect to happen?

no error

What actually happened?

> projectxy@1.4.0 lint:next
> next lint

info  - Loaded env from /Users/me/src/projects/projectxy/.env.local
Cannot read properties of undefined (reading 'getAllComments')
Occurred while linting /Users/me/src/projects/projectxy/src/middleware.ts:1
Rule: "unicorn/expiring-todo-comments"
ERROR: "lint:next" exited with 1.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/nextjs-v3bpaa?file=package.json

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@dahiro dahiro added bug ESLint is working incorrectly repro:needed labels May 8, 2023
dahiro added a commit to dahiro/eslint that referenced this issue May 8, 2023
@mdjermanovic mdjermanovic added the needs info Not enough information has been provided to triage this issue label May 8, 2023
@mdjermanovic
Copy link
Member

Hi @dahiro, thanks for the issue!

Can you please provide a repro repo? I believe this is a problem in eslint-plugin-unicorn.

@dahiro
Copy link
Author

dahiro commented May 8, 2023

Hi @dahiro, thanks for the issue!

Can you please provide a repro repo? I believe this is a problem in eslint-plugin-unicorn.

https://stackblitz.com/edit/nextjs-v3bpaa?file=package.json

You were right, updating eslint-plugin-unicorn to the latest version fixed the issue as well. Thanks for pointing me in the right direction

@dahiro dahiro closed this as completed May 8, 2023
@eslint-github-bot
Copy link

It looks like there wasn't enough information for us to know how to help you, so we're closing the issue.

Thanks for your understanding.

@ryancwalsh
Copy link

@dahiro Thanks! I needed to upgrade my eslint-plugin-unicorn too.

@ryancwalsh
Copy link

Never mind. I'm still having the problem.

@Rec0iL99
Copy link
Member

@ryancwalsh we don't track closed issues much. If you are facing a problem with an error, please open a new discussion with a repro repo and we'll help you there. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly needs info Not enough information has been provided to triage this issue repro:needed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants