Skip to content

Commit 0655cad

Browse files
committed
fix: workaround upstream nuxt issue
1 parent bda30f5 commit 0655cad

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

nuxt.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ export default defineNuxtConfig({
77
nuxt.options.pwa.pwaAssets.disabled = true
88
}
99
},
10+
// Workaround for Nuxt 4.3.0 regression: https://github.com/nuxt/nuxt/issues/34140
11+
// shared-imports.d.ts pulls in app composables during type-checking of shared context,
12+
// but the shared context doesn't have access to auto-import globals.
13+
// TODO: Remove when Nuxt fixes this upstream
14+
function (_, nuxt) {
15+
nuxt.hook('prepare:types', ({ sharedReferences }) => {
16+
const idx = sharedReferences.findIndex(
17+
ref => 'path' in ref && ref.path.endsWith('shared-imports.d.ts'),
18+
)
19+
if (idx !== -1) {
20+
sharedReferences.splice(idx, 1)
21+
}
22+
})
23+
},
1024
'@unocss/nuxt',
1125
'@nuxtjs/html-validator',
1226
'@nuxt/scripts',

shared/utils/npm.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { createError } from 'h3'
12
import validatePackageName from 'validate-npm-package-name'
23

34
/**

0 commit comments

Comments
 (0)