From 8e793ad5ccb285c429d2ab733600add981b2782c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 7 May 2024 13:56:13 +0100 Subject: [PATCH] fix(nuxt): use resolved path for test component import --- packages/nuxt/src/app/components/test-component-wrapper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/components/test-component-wrapper.ts b/packages/nuxt/src/app/components/test-component-wrapper.ts index 31520ae0b9..1581e09364 100644 --- a/packages/nuxt/src/app/components/test-component-wrapper.ts +++ b/packages/nuxt/src/app/components/test-component-wrapper.ts @@ -16,9 +16,9 @@ export default (url: string) => defineComponent({ if (!path.startsWith(devRootDir)) { throw new Error(`[nuxt] Cannot access path outside of project root directory: \`${path}\`.`) } - const comp = await import(/* @vite-ignore */ query.path as string).then(r => r.default) + const comp = await import(/* @vite-ignore */ path as string).then(r => r.default) return () => [ - h('div', 'Component Test Wrapper for ' + query.path), + h('div', 'Component Test Wrapper for ' + path), h('div', { id: 'nuxt-component-root' }, [ h(comp, { ...attrs, ...props, ...urlProps }), ]),