Skip to content

unresolved alias in mdx files (3.7.0 works, 3.8.x fails) #367

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

Closed
chrisweb opened this issue Mar 8, 2025 · 4 comments
Closed

unresolved alias in mdx files (3.7.0 works, 3.8.x fails) #367

chrisweb opened this issue Mar 8, 2025 · 4 comments

Comments

@chrisweb
Copy link

chrisweb commented Mar 8, 2025

I created a reproduction for a Next.js project with support for MDX files: https://github.com/chrisweb/eslint-import-resolver-typescript_mdx_reproduction

After migrating to eslint-import-resolver-typescript 3.8.x a new "import/no-unresolved" linting error started to appear

It could be related to #363 (if there is a PR to fix 363 I will check if it also solves the problem mentioned here)

I was hoping the #360 PR (from the #359 ticket) would fix the problem but it did not

@JounQin
Copy link
Collaborator

JounQin commented Mar 8, 2025

cc @carlocorradini

@carlocorradini
Copy link
Contributor

@chrisweb
We throw the error because the .mdx file is not present in your tsconfig.json and has not been mapped.
A possible solution (future fix) is provided in #363 (comment), but I have not received any feedback.

Temporary fix:

--- a/tsconfig.json
+++ b/tsconfig.json
@@ -32,6 +32,7 @@
       "next-env.d.ts",
       "**/*.ts",
       "**/*.tsx",
+      "**/*.mdx",
       ".next/types/**/*.ts"
   ],
   "exclude": [

@carlocorradini
Copy link
Contributor

@JounQin We can close this. Duplicate of #363

@JounQin
Copy link
Collaborator

JounQin commented Mar 10, 2025

Duplicate of #363

@JounQin JounQin marked this as a duplicate of #363 Mar 10, 2025
@JounQin JounQin closed this as completed Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants