microsoft/vscode-eslint

error: `Request textDocument/codeAction failed with message: Range#create called with invalid arguments[[object Object], [object Object], undefined, undefined]`

ulugbekna opened this issue · 11 comments

Not sure how to repro, but I get this error in dev console:

 ERR Request textDocument/codeAction failed with message: Range#create called with invalid arguments[[object Object], [object Object], undefined, undefined]: Error: Request textDocument/codeAction failed with message: Range#create called with invalid arguments[[object Object], [object Object], undefined, undefined]
    at ae (/Users/ulugbekna/.vscode-insiders/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:41596)
    at re (/Users/ulugbekna/.vscode-insiders/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:39556)
    at Immediate.<anonymous> (/Users/ulugbekna/.vscode-insiders/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:35850)
    at processImmediate (node:internal/timers:478:21)

Image

Feel free to close if not actionable.

Hard to say. It tries to create a range with invalid positions, but unsure why. I think they come invalid from ESLint. If you can have steps or a file you are seeing it in would be helpful.

facing same issues.

vs code v 1.94.1
OS: Ubuntu 24.04

having below settings in settings.json and also in .code-workspace file

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.fixAll": "explicit",
    "source.organizeImports": "explicit"
  },
  "eslint.useFlatConfig": true,
  "eslint.validate": [
    "mdx",
    "javascript",
    "typescript"
  ],
  "eslint.options": {
    "extensions": [
      ".js",
      ".md",
    ],
  },

and whenever we save js /md file it gives below message in Vs Code Output Panel

2024-10-09 19:16:06.781 [error] [dbaeumer.vscode-eslint] provider FAILED
2024-10-09 19:16:06.781 [error] Error: Request textDocument/codeAction failed with message: Invalid Options:
- Unknown options: extensions
- 'extensions' has been removed.
    at ae (/home/user/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:41596)
    at re (/home/user/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:39556)
    at Immediate.<anonymous> (/home/user/.vscode/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:35850)
    at processImmediate (node:internal/timers:483:21)

@xkeshav any steps on how to reproduce this. Would like to understand why this is happening. Simply dropping the range / problem is not a good fix.

@dbaeumer here is minimal repruction repo link using vs code web: https://stunning-guacamole-vw7vgxx5qfwp94.github.dev/

please check the README and let me know if it help.

Thanks

@xkeshav I can't access that code space. Could you provide me with a GitHub repository I can clone.

Oh. Why access issue? No I haven't made any repo but just open codespace and write.

Is there any other way? Stackblitz does not give the option to install extension

Let me check the access issue.

here is the repo ; please check and let me know whether you are able to generate

- 'extensions' has been removed.
    at ae (/home/codespace/.vscode-remote/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:41596)
    at re (/home/codespace/.vscode-remote/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:39556)
    at Immediate.<anonymous> (/home/codespace/.vscode-remote/extensions/dbaeumer.vscode-eslint-3.0.10/client/out/extension.js:1:35850)
    at processImmediate (node:internal/timers:483:21)

comes from the fact that you have this

    "eslint.options": {
      "extensions": [
        ".js",
        ".md",
      ],
    },

in your workspace file. In ESLint 9.x the extensions setting is not supported anymore since you use sections in the config file instead.

How would I reproduce the Request textDocument/codeAction failed with message: Range#create called with invalid arguments[[object Object], [object Object], undefined, undefined] error with your example?

my issue has been resolved by removing the settings . Thanks @dbaeumer

I will close the issue for now since I can't reproduce this.

As soon as someone can, please ping and I will re-open the issue.