@@ -92,6 +92,9 @@ export async function setupAI(nuxt: Nuxt, hub: HubConfig) {
9292 if ( nuxt . options . dev && ! hub . remote && ! hub . projectKey ) {
9393 return log . warn ( '`hubAI()` is disabled: link a project with `npx nuxthub link` to run AI models in development mode.' )
9494 }
95+
96+ // Register auto-imports first so types are correct even when not running remotely
97+ addServerImportsDir ( resolve ( './runtime/ai/server/utils' ) )
9598 // If we are in dev mode and the project is linked, verify it
9699 if ( nuxt . options . dev && ! hub . remote && hub . projectKey ) {
97100 try {
@@ -115,7 +118,6 @@ export async function setupAI(nuxt: Nuxt, hub: HubConfig) {
115118 }
116119 // Add Server scanning
117120 addServerScanDir ( resolve ( './runtime/ai/server' ) )
118- addServerImportsDir ( resolve ( './runtime/ai/server/utils' ) )
119121}
120122
121123export function setupAnalytics ( _nuxt : Nuxt ) {
@@ -134,6 +136,8 @@ export function setupBlob(_nuxt: Nuxt) {
134136}
135137
136138export 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' ) )
137141 // Check if dependencies are installed
138142 const missingDeps = [ ]
139143 try {
@@ -156,7 +160,6 @@ export async function setupBrowser(nuxt: Nuxt) {
156160 }
157161 // Add Server scanning
158162 // addServerScanDir(resolve('./runtime/browser/server'))
159- addServerImportsDir ( resolve ( './runtime/browser/server/utils' ) )
160163}
161164
162165export async function setupCache ( nuxt : Nuxt ) {
@@ -206,13 +209,14 @@ export function setupKV(_nuxt: Nuxt) {
206209}
207210
208211export 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' ) )
209214 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 .' )
211216 return
212217 }
213218 // Add Server scanning
214219 addServerScanDir ( resolve ( './runtime/vectorize/server' ) )
215- addServerImportsDir ( resolve ( './runtime/vectorize/server/utils' ) )
216220}
217221
218222export function vectorizeRemoteCheck ( hub : HubConfig ) {
0 commit comments