Skip to content

Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.js#overrides[0]': Cannot find module '@typescript-eslint/parser' #10273

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

Open
1 of 9 tasks
kkazala opened this issue May 20, 2025 · 8 comments
Assignees
Labels
area:spfx Category: SharePoint Framework (not extensions related) type:bug-confirmed Confirmed bug, not working as designed / expected. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@kkazala
Copy link
Contributor

kkazala commented May 20, 2025

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version: N/A
  • SPFx version: 1.21.1
  • Node.js version: 22.14.0

Describe the bug / error

I created new project using yo @microsoft/sharepoint --package-manager pnpm command.
After installing dependencies (pnpm i) and rebuilding the project (gulp build) I'm getting an error:

Error - [lint] Unexpected STDERR output from ESLint: 
Oops! Something went wrong! :(
ESLint: 8.57.1
Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.js#overrides[0]': Cannot find module '@typescript-eslint/parser'
Require stack:
- D:/Samples/SPFx/v1.21/.eslintrc.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.resolve (node:internal/modules/helpers:146:19)
    at Object.resolve (D:/Samples/SPFx/v1.21/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (D:/Samples/SPFx/v1.21/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (D:/Samples/SPFx/v1.21/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (D:/Samples/SPFx/v1.21/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (D:/Samples/SPFx/v1.21/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3133:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)

Error - [lint]

I didn't change a single thing in the package.json, tsconfig.json or .eslintrc.js

Steps to reproduce

  1. Install node v22, and latest yeoman generator
  2. create new project using pnpm package manager
    yo @microsoft/sharepoint --package-manager pnpm
  3. run pnpm i
  4. run gulp build

Expected behavior

Build without an error =)

The question here is: which version of the @typescript-eslint/parser should I add to project dependencies?
Reviewing pnpm-lock.yaml, I see v5.20 but this gives
Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used. Use 'identifierToKeywordKind(identifier)' instead.

Adding ^6.0.0 solved the issue, but I also see various v8. I wonder what is the recommended approach here, so I don't have more problems and work down the road =)

@kkazala kkazala added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label May 20, 2025
@kkazala
Copy link
Contributor Author

kkazala commented May 20, 2025

I didn't have to wait long =)

@typescript-eslint/parser version ^6.0.0 will throw Rule: "@typescript-eslint/no-duplicate-enum-values" for enum:

enum ProcessDef {
  CONFIG_LIST = "ConfigCommit",
  COMMAND_NAME = "COMMAND_COMMIT",
}

So.... version 8 then?
I will leave this issue open, perhaps you would like to consider it for the next version?

@Amey-MSFT
Copy link

Hello @kkazala,
Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

@Amey-MSFT Amey-MSFT self-assigned this May 21, 2025
@Amey-MSFT
Copy link

Hello @kkazala,
Did you install @typescript-eslint/parser@^8.0.0, as it ensures compatibility with ESLint 8.57.1 and avoids deprecation issues (e.g., originalKeywordKind) seen in v5/v6

@kkazala
Copy link
Contributor Author

kkazala commented May 22, 2025

@Amey-MSFT I did, but I had to add it myself. And I had to find out which version should be installed first =)

The issue I'm reporting is that @typescript-eslint/parser@^8.0.0 is not in package.json of newly created projects, and when using pnpm package manager, the solution does not build.

Since pnpm package manager is supported, it would be nice to have all dependencies referenced in package.json, instead of letting developers figure it out :) I am sure they will (figure it out) but they will waste time.

Hope this explanation helps =)

@Amey-MSFT
Copy link

Hello @kkazala,
So, I will proceed with this by raising as feature request.
Meanwhile you can also raise a feature request by using this link :- SharePoint · Community

@kkazala
Copy link
Contributor Author

kkazala commented May 26, 2025 via email

@Amey-MSFT
Copy link

Hello @kkazala,
Apologies for the misunderstanding,
We were able to reproduce the issue, and we are investigating it. We have logged this as a bug, and our engineering team will look into it.
Thank you!

@Amey-MSFT Amey-MSFT added area:spfx Category: SharePoint Framework (not extensions related) type:bug-confirmed Confirmed bug, not working as designed / expected. labels May 26, 2025
@kkazala
Copy link
Contributor Author

kkazala commented May 26, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:spfx Category: SharePoint Framework (not extensions related) type:bug-confirmed Confirmed bug, not working as designed / expected. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

2 participants