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
ESLint import/no-unresolved on 3.7.0 when importing with @-alias #22994
Comments
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
Same here, no alias imports are working. |
It seems to be related to the // .eslintrc
{
"settings": {
"import/resolver": {
"typescript": {
"project": "./.nuxt/tsconfig.json"
}
}
}
} Possibly related: dividab/tsconfig-paths#224 |
Can confirm. here when it resolves |
Thanks for the debugging. This isn't a Nuxt issue, it seems, so I'm closing. But if you think there's something we should be doing, please feel free to let me know. |
Environment
Reproduction
Create a new nuxt project, add a new custom folder and place a js file inside. Try to import this file. Enable linting and you should be able to reproduce the error on build.
Describe the bug
Prior to Nuxt 3.7.0 this was working fine. When importing a file from a non standard root level folder with the "@"-alias we now receive a linting error on build and on lint, but not when running nuxi dev:
import fragment from '@/shaders/fragment.glsl'
or
import math from '@/lib/math.js'
On build we than receive the error:
6:20 error Unable to resolve path to module '@/shaders/fragment.glsl' import/no-unresolved
When using
import fragment from '../shaders/fragment.glsl'
instead, everything's working fine.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: