Skip to content

Commit

Permalink
fix: prevent undefined error in hasTypeExport
Browse files Browse the repository at this point in the history
`names` can be null with star exports. Upstream fix to improve ts: unjs/mlly#273

Fixes nuxt#309
  • Loading branch information
tobiasdiez authored Aug 13, 2024
1 parent 07f27bb commit 8357303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async function writeTypes(distDir: string, isStub: boolean) {
const schemaImports: string[] = []
const moduleExports: string[] = []

const hasTypeExport = (name: string) => isStub || moduleReExports.find(exp => exp.names.includes(name))
const hasTypeExport = (name: string) => isStub || moduleReExports.find(exp => exp.names?.includes(name))

if (!hasTypeExport('ModuleOptions')) {
schemaImports.push('NuxtModule')
Expand Down

0 comments on commit 8357303

Please sign in to comment.