@@ -16,6 +16,7 @@ import resolveFrom from './util/resolveFrom'
1616import { type Feature , supportedFeatures } from '@tailwindcss/language-service/src/features'
1717import { pathToFileURL } from 'node:url'
1818import { resolveCssImports } from './resolve-css-imports'
19+ import type { GlobEntry } from '@tailwindcss/oxide'
1920
2021export interface ProjectConfig {
2122 /** The folder that contains the project */
@@ -439,27 +440,34 @@ async function* contentSelectorsFromCssConfig(entry: ConfigEntry): AsyncIterable
439440 } else if ( item . kind === 'auto' && ! auto ) {
440441 auto = true
441442 for await ( let file of detectContentFiles ( entry . packageRoot ) ) {
442- yield {
443- pattern : normalizePath ( file ) ,
444- priority : DocumentSelectorPriority . CONTENT_FILE ,
443+ if ( typeof file === 'string' ) {
444+ yield {
445+ pattern : normalizePath ( file ) ,
446+ priority : DocumentSelectorPriority . CONTENT_FILE ,
447+ }
445448 }
446449 }
447450 }
448451 }
449452}
450453
451- async function * detectContentFiles ( base : string ) : AsyncIterable < string > {
454+ async function * detectContentFiles ( base : string ) : AsyncIterable < string | GlobEntry > {
452455 try {
453456 let oxidePath = resolveFrom ( path . dirname ( base ) , '@tailwindcss/oxide' )
454457 oxidePath = pathToFileURL ( oxidePath ) . href
455458
456459 // This isn't a v4 project
457460 const oxide = await import ( oxidePath )
458- if ( ! oxide . scanDir ) {
461+
462+ function validateOxide ( input : any ) : input is typeof import ( '@tailwindcss/oxide' ) {
463+ return ! ! oxide . scanDir
464+ }
465+
466+ if ( ! validateOxide ( oxide ) ) {
459467 return
460468 }
461469
462- let { files, globs } = await oxide . scanDir ( { base, globs : true } )
470+ let { files, globs } = oxide . scanDir ( { base, globs : true } )
463471
464472 yield * files
465473 yield * globs
0 commit comments