Skip to content

🐛 Migrate Eslint fails on module D #5387

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 task done
Cajuteq opened this issue Mar 18, 2025 · 2 comments
Open
1 task done

🐛 Migrate Eslint fails on module D #5387

Cajuteq opened this issue Mar 18, 2025 · 2 comments
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@Cajuteq
Copy link

Cajuteq commented Mar 18, 2025

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v23.6.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.9.0"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

I followed the getting started followed by Migrate from ESLint and Prettier so the steps are :
npm install --save-dev --save-exact @biomejs/biome
npx @biomejs/biome init
npx @biomejs/biome migrate prettier --write
npx @biomejs/biome migrate eslint --write

on that last command I get

PS D:\Dev\tktm\packages\frontend> npx @biomejs/biome migrate eslint --write  
migrate ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Migration has encountered an error: `node` was invoked to resolve 'eslint-config-next'. This invocation failed with the following error:
    D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\_patch-base.js:167
                throw new Error('Failed to patch ESLint because the calling module was not recognized.\n' +
                      ^

    Error: Failed to patch ESLint because the calling module was not recognized.
    If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
    https://github.com/microsoft/rushstack/issues
        at Object.<anonymous> (D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\_patch-base.js:167:19)
        at Module._compile (node:internal/modules/cjs/loader:1739:14)
    Error: Failed to patch ESLint because the calling module was not recognized.
    If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
    https://github.com/microsoft/rushstack/issues
        at Object.<anonymous> (D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\_patch-base.js:167:19)
        at Module._compile (node:internal/modules/cjs/loader:1739:14)
    If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
    https://github.com/microsoft/rushstack/issues
        at Object.<anonymous> (D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\_patch-base.js:167:19)
        at Module._compile (node:internal/modules/cjs/loader:1739:14)
    https://github.com/microsoft/rushstack/issues
        at Object.<anonymous> (D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\_patch-base.js:167:19)
        at Module._compile (node:internal/modules/cjs/loader:1739:14)
        at Object.<anonymous> (D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\_patch-base.js:167:19)
        at Module._compile (node:internal/modules/cjs/loader:1739:14)
        at Module._compile (node:internal/modules/cjs/loader:1739:14)
        at Object..js (node:internal/modules/cjs/loader:1904:10)
        at Module.load (node:internal/modules/cjs/loader:1473:32)
        at Function._load (node:internal/modules/cjs/loader:1285:12)
        at TracingChannel.traceSync (node:diagnostics_channel:322:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
        at Module.require (node:internal/modules/cjs/loader:1495:12)
        at require (node:internal/modules/helpers:135:16)
        at Object.<anonymous> (D:\Dev\tktm\packages\frontend\node_modules\@rushstack\eslint-patch\lib\modern-module-resolution.js:11:23)

    Node.js v23.6.1



migrate ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Migration has encountered an error: The module D cannot be resolved. This is likely an internal error.


No changes to apply to the Biome configuration file.

My .eslintrc.json is pretty simple

{
  "extends": ["next", "next/core-web-vitals", "prettier"],
  "rules": {
    "@next/next/no-img-element": "off",
    "react-hooks/exhaustive-deps": "off"
  }
}

Expected result

I expected npx @biomejs/biome migrate eslint --write to do a flawless migration

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Cajuteq Cajuteq added the S-Needs triage Status: this issue needs to be triaged label Mar 18, 2025
@ematipico
Copy link
Member

Probably duplicate of #2935, can you confirm @Cajuteq ?

@Cajuteq
Copy link
Author

Cajuteq commented Mar 18, 2025

Hi, the aforementioned issue is similar but it seems there is more in my case. I applied the suggested fix, that is :
1 commenting require('@rushstack/eslint-patch/modern-module-resolution') in node_modules/eslint-config-next/index.js
2 running again npx @biomejs/biome migrate eslint --write

I obtained :

PS D:\Dev\tktm\packages\frontend> npx @biomejs/biome migrate eslint --write
migrate ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Migration has encountered an error: The module D cannot be resolved. This is likely an internal error.


.eslintrc.json has been successfully migrated.

It seems the biome.json is different from before but running npx @biomejs/biome check does not produces the same file as eslint and for example removes all trailing semi-column

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants