-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Can't get the plugin to work with Nuxt and Vitest #123
Comments
I'm not familiar with Nuxt. Why do they use |
Hello! A bit more explanation: So basically Nuxt dev used custom paths like So in most common Nuxt project, we will have two tsconfig:
Later in nuxt update, every path aliases on the .nuxt tsconfig now has relative paths with added Now the problem is on Vitest, using So, absolutely, vite-tsconfig-paths will resolve any path aliases of Overall, it's not just the in summary, currently any tsconfig that has relative paths AND placed inside subfolders of root project will misbehave: // This is broken
"paths": {
"~": [
".."
],
"~/*": [
"../*"
],
"assets": [
"../assets"
],
"public": [
"../public"
],
"public/*": [
"../public/*"
],
} |
@datsenkoboos or @akasection, did you guys ever managed to find a solution for this? |
This might be related to this issue here: nuxt/nuxt#26512 It seems nuxt changed the way their |
@JasonLandbridge not a solution though; just a workaround. For nuxt >= 3.8, adding
|
For me it also helped to downgrade the |
This definitely did not work and broke the most things.
This had no effect. I think ultimately this plugin doesn't actually support tsconfig paths. |
Here's an example of how to do the resolution: https://github.com/nuxt/module-builder/blob/main/src/commands/build.ts#L279-L295 |
Hi, i'm trying to use Vitest and Nuxt 3 with its "explicit" imports from
'#imports'
which is declared intsconfig.json
:tsconfig.json
in the root of the project"./.nuxt/tsconfig.json"
Vitest can't resolve the import even with
vite-tsconfig-paths
:vite.config.ts
Am i doing anything wrong?
The text was updated successfully, but these errors were encountered: