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

Occasional undefined error when formatting a TypeScript file #11189

Open
1 task done
micthiesen opened this issue Apr 29, 2024 · 3 comments
Open
1 task done

Occasional undefined error when formatting a TypeScript file #11189

micthiesen opened this issue Apr 29, 2024 · 3 comments
Labels
defect [core label] eslint ESLint tooling support language An umbrella label for all programming languages syntax behaviors regression A bug that was introduced in a recent release tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support

Comments

@micthiesen
Copy link

micthiesen commented Apr 29, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When saving a file the following error is logged but only sometimes (error seems intermittent):

Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')

And formatting doesn't happen.

These are my TS-specific settings, but I've had different settings too and it still happens:

    "TypeScript": {
      "formatter": "prettier",
      "code_actions_on_format": {
        "source.organizeImports": true,
        "source.fixAll.eslint": true
      }
    },

Environment

Zed: v0.132.4 (Zed)
OS: macOS 14.1.2
Memory: 32 GiB
Architecture: aarch64

"typescript": "^5.3.3",
"prettier": "^3.1.1",
"eslint": "^8.56.0",

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

2024-04-29T13:26:43-07:00 [WARN] Generic lsp request to node failed: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')
2024-04-29T13:26:43-07:00 [ERROR] crates/project/src/project.rs:6892: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')
@micthiesen micthiesen added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Apr 29, 2024
@micthiesen
Copy link
Author

I think maybe this is because I'm using a version of ESLint that's <9? Unfortunately I can't update it as some other packages don't support newer versions of ESLint.

@chrisvariety
Copy link

I'm seeing this as well. Reverting back to Zed 0.130.7 resolves, so I think this was introduced in v0.131.6 if that's helpful.

@JosephTLyons JosephTLyons added typescript TypeScript programming language support language An umbrella label for all programming languages syntax behaviors eslint ESLint tooling support tooling An umbrella label for language tools, linters, formatters, etc regression A bug that was introduced in a recent release and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 30, 2024
@choco-green
Copy link

choco-green commented May 1, 2024

Getting a difference on a different line number on editor.rs
2024-05-01T19:48:00+01:00 [WARN] Generic lsp request to node failed: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')
2024-05-01T19:48:00+01:00 [ERROR] crates/editor/src/editor.rs:8417: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')
2024-05-01T19:48:07+01:00 [WARN] Generic lsp request to node failed: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')
2024-05-01T19:48:07+01:00 [ERROR] crates/editor/src/editor.rs:8417: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading 'disableRuleComment')

Maybe due to update?
Zed: v0.133.5 (Zed)
OS: macOS 14.5.0
Memory: 64 GiB
Architecture: aarch64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] eslint ESLint tooling support language An umbrella label for all programming languages syntax behaviors regression A bug that was introduced in a recent release tooling An umbrella label for language tools, linters, formatters, etc typescript TypeScript programming language support
Projects
None yet
Development

No branches or pull requests

4 participants