@@ -92,6 +92,9 @@ export async function setupAI(nuxt: Nuxt, hub: HubConfig) {
92
92
if ( nuxt . options . dev && ! hub . remote && ! hub . projectKey ) {
93
93
return log . warn ( '`hubAI()` is disabled: link a project with `npx nuxthub link` to run AI models in development mode.' )
94
94
}
95
+
96
+ // Register auto-imports first so types are correct even when not running remotely
97
+ addServerImportsDir ( resolve ( './runtime/ai/server/utils' ) )
95
98
// If we are in dev mode and the project is linked, verify it
96
99
if ( nuxt . options . dev && ! hub . remote && hub . projectKey ) {
97
100
try {
@@ -115,7 +118,6 @@ export async function setupAI(nuxt: Nuxt, hub: HubConfig) {
115
118
}
116
119
// Add Server scanning
117
120
addServerScanDir ( resolve ( './runtime/ai/server' ) )
118
- addServerImportsDir ( resolve ( './runtime/ai/server/utils' ) )
119
121
}
120
122
121
123
export function setupAnalytics ( _nuxt : Nuxt ) {
@@ -134,6 +136,8 @@ export function setupBlob(_nuxt: Nuxt) {
134
136
}
135
137
136
138
export async function setupBrowser ( nuxt : Nuxt ) {
139
+ // Register auto-imports first so types are correct even when not running remotely
140
+ addServerImportsDir ( resolve ( './runtime/browser/server/utils' ) )
137
141
// Check if dependencies are installed
138
142
const missingDeps = [ ]
139
143
try {
@@ -156,7 +160,6 @@ export async function setupBrowser(nuxt: Nuxt) {
156
160
}
157
161
// Add Server scanning
158
162
// addServerScanDir(resolve('./runtime/browser/server'))
159
- addServerImportsDir ( resolve ( './runtime/browser/server/utils' ) )
160
163
}
161
164
162
165
export async function setupCache ( nuxt : Nuxt ) {
@@ -206,13 +209,14 @@ export function setupKV(_nuxt: Nuxt) {
206
209
}
207
210
208
211
export function setupVectorize ( nuxt : Nuxt , hub : HubConfig ) {
212
+ // Register auto-imports first so types are correct even when not running remotely
213
+ addServerImportsDir ( resolve ( './runtime/vectorize/server/utils' ) )
209
214
if ( nuxt . options . dev && ! hub . remote ) {
210
- log . warn ( '`hubVectorize()` is disabled: it is currently only supported with `-- remote` .' )
215
+ log . warn ( '`hubVectorize()` is disabled: only supported with remote storage in development mode .' )
211
216
return
212
217
}
213
218
// Add Server scanning
214
219
addServerScanDir ( resolve ( './runtime/vectorize/server' ) )
215
- addServerImportsDir ( resolve ( './runtime/vectorize/server/utils' ) )
216
220
}
217
221
218
222
export function vectorizeRemoteCheck ( hub : HubConfig ) {
0 commit comments