Relative type/interface import in Webpack boilerplate on Windows- fixing [@vue/compiler-sfc] Failed to resolve import source #9473
-
Hello 👋🏻 Context: So: For some reasons relative imports are failing. <script lang="ts" setup>
import type { OssCardProps } from './types'; // <- this guy 😤
import { BaseImage } from '../base';
const props = defineProps<OssCardProps>();
</script>
<template>
<article class="card shadow-sm">
<BaseImage class="card-img-top" :src="props.src" :alt="props.alt" lazy />
<div class="card-body">
<h5 class="card-title">{{ props.title }}</h5>
<p class="card-text">
{{ props.description }}
</p>
</div>
</article>
</template> Error is But: <script lang="ts" setup>
import type { OssCardProps } from 'src/client/components/open-source/types'; // <- this works 🤔
import { BaseImage } from '../base';
const props = defineProps<OssCardProps>();
</script>
<template>
<article class="card shadow-sm">
<BaseImage class="card-img-top" :src="props.src" :alt="props.alt" lazy />
<div class="card-body">
<h5 class="card-title">{{ props.title }}</h5>
<p class="card-text">
{{ props.description }}
</p>
</div>
</article>
</template> This one is OK. FYI: I'm not using I tried doing the same with What am I missing? Thank you in advance! UPDATE: This issue is only happening on Windows machine. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
The error is coming from There is a PR to fix this |
Beta Was this translation helpful? Give feedback.
-
My project is the latest version of vue 3.5.1, why do I have this problem, my computer is Windows system |
Beta Was this translation helpful? Give feedback.
-
// .vue <script setup lang="ts" name="triggerButton"> import { ChevronBackOutline, ChevronUp } from '@vicons/ionicons5' import { computed } from 'vue' // There is no problem with this introduction,But it seems to get errors on the mac, too // import { ButtonProps } from '@/directives/splitTrigger/types' import { ButtonProps } from './types' const props = withDefaults(defineProps(), { direction: 'horizontal', expand: true, position: 'center' }) </script>// vue version // error info anonymous.vue |
Beta Was this translation helpful? Give feedback.
This issue was fixed in
@vue/compiler-sfc
v3.3.7