Skip to content

Commit 66edb9b

Browse files
committed
fix(script): detect runtime Unhead capabilities
1 parent ce9e794 commit 66edb9b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/script/src/module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,9 @@ export default defineNuxtModule<ModuleOptions>({
609609
}
610610
// If Unhead cannot be resolved, retain the compatibility implementation.
611611
const unheadPackagePath = await resolvePackageJSON('@unhead/vue', {
612-
from: nuxt.options.modulesDir,
612+
// Match the package instance imported by the built runtime. An app can
613+
// contain another Unhead version with different loader capabilities.
614+
from: [resolveModule('./runtime')],
613615
}).catch(() => {
614616
// @unhead/vue is optional; unresolved installs use the local compatibility path.
615617
return null

0 commit comments

Comments
 (0)