diff --git a/packages/nuxt/playground/play-extends-layer/app.vue b/packages/nuxt/playground/play-extends-layer/app.vue
new file mode 100644
index 0000000000..c0a035c97d
--- /dev/null
+++ b/packages/nuxt/playground/play-extends-layer/app.vue
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/packages/nuxt/playground/play-extends-layer/nuxt.config.ts b/packages/nuxt/playground/play-extends-layer/nuxt.config.ts
new file mode 100644
index 0000000000..0ae4393e72
--- /dev/null
+++ b/packages/nuxt/playground/play-extends-layer/nuxt.config.ts
@@ -0,0 +1,9 @@
+import { defineNuxtConfig } from 'nuxt/config'
+
+export default defineNuxtConfig({
+ extends: ['..'],
+
+ devtools: { enabled: true },
+
+ compatibilityDate: '2024-09-26',
+})
diff --git a/packages/nuxt/playground/play-extends-layer/package.json b/packages/nuxt/playground/play-extends-layer/package.json
new file mode 100644
index 0000000000..91a3de0972
--- /dev/null
+++ b/packages/nuxt/playground/play-extends-layer/package.json
@@ -0,0 +1,8 @@
+{
+ "private": true,
+ "type": "module",
+ "name": "pinia-nuxt-playground-extends-layer",
+ "scripts": {
+ "dev": "nuxt dev"
+ }
+}
diff --git a/packages/nuxt/playground/play-extends-layer/tsconfig.json b/packages/nuxt/playground/play-extends-layer/tsconfig.json
new file mode 100644
index 0000000000..4b34df1571
--- /dev/null
+++ b/packages/nuxt/playground/play-extends-layer/tsconfig.json
@@ -0,0 +1,3 @@
+{
+ "extends": "./.nuxt/tsconfig.json"
+}
diff --git a/packages/nuxt/playground/tsconfig.json b/packages/nuxt/playground/tsconfig.json
index 4b34df1571..39333429c3 100644
--- a/packages/nuxt/playground/tsconfig.json
+++ b/packages/nuxt/playground/tsconfig.json
@@ -1,3 +1,4 @@
{
- "extends": "./.nuxt/tsconfig.json"
+ "extends": "./.nuxt/tsconfig.json",
+ "exclude": ["./play-extends-layer"]
}
diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts
index b425bda4e4..ed1684a37f 100644
--- a/packages/nuxt/src/module.ts
+++ b/packages/nuxt/src/module.ts
@@ -101,6 +101,10 @@ const module: NuxtModule = defineNuxtModule({
if (options.storesDirs) {
for (const storeDir of options.storesDirs) {
addImportsDir(resolve(nuxt.options.rootDir, storeDir))
+
+ for (const layer of nuxt.options._layers) {
+ addImportsDir(resolve(layer.config.rootDir, storeDir))
+ }
}
}
},