We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
srcDir
https://stackblitz.com/edit/nuxt-pinia-autoimport-repro1?file=nuxt.config.ts
You can see the error when you open the reproduction link.
src/stores/[name].ts
app.vue
It should be automatically imported from ~~/src/stores/[name].ts = ~/stores/[name].ts.
~~/src/stores/[name].ts
~/stores/[name].ts
but, it tries to resolve imports from ~~/stores/[name].ts = ~/../stores/[name].ts.
~~/stores/[name].ts
~/../stores/[name].ts
stores
https://stackblitz.com/edit/nuxt-pinia-autoimport-repro2?file=nuxt.config.ts
srcDir Option: https://nuxt.com/docs/api/configuration/nuxt-config#srcdir
Auto-importing directories without any configuration is an attractive feature for me. I hope it will be resolved.
Note: Sorry, I'm using Google Translate, so my English may be difficult to understand.
The text was updated successfully, but these errors were encountered:
pinia/packages/nuxt/src/module.ts
Line 97 in 3eee335
My guess is that this line should be srcDir (default: rootDir)
if (options.storesDirs) { for (const storeDir of options.storesDirs) { - addImportsDir(resolver.resolve(nuxt.options.rootDir, storeDir)) + addImportsDir(resolver.resolve(nuxt.options.srcDir, storeDir)) } }
Sorry, something went wrong.
I think what you are suggesting is the right direction. Worth doing a few extra tests
dd90708
No branches or pull requests
Reproduction
https://stackblitz.com/edit/nuxt-pinia-autoimport-repro1?file=nuxt.config.ts
Steps to reproduce the bug
You can see the error when you open the reproduction link.
srcDir
option in nuxtConfig.src/stores/[name].ts
app.vue
Expected behavior
It should be automatically imported from
~~/src/stores/[name].ts
=~/stores/[name].ts
.but, it tries to resolve imports from
~~/stores/[name].ts
=~/../stores/[name].ts
.Actual behavior
stores
directory insrcDir
(not work)https://stackblitz.com/edit/nuxt-pinia-autoimport-repro1?file=nuxt.config.ts
stores
directory in root (it work)https://stackblitz.com/edit/nuxt-pinia-autoimport-repro2?file=nuxt.config.ts
Additional information
srcDir
Option: https://nuxt.com/docs/api/configuration/nuxt-config#srcdirAuto-importing directories without any configuration is an attractive feature for me.
I hope it will be resolved.
Note: Sorry, I'm using Google Translate, so my English may be difficult to understand.
The text was updated successfully, but these errors were encountered: