iles: `useDocuments` paths are incorrectly resolved in Windows
- I have read the troubleshooting section before opening an issue.
- I have tried upgrading
ilesandvite.
Description 📖
<script setup lang="ts">
const posts = useDocuments("~/posts")
</script>
<template>
<a v-for="post of posts" :key="post.href" :href="post.href">
{{ post.title }}
<component :is="post" excerpt />
</a>
</template>
Similar code appears differently in different components (specifically, Header.vue and List.vue). Header.vue is fine, while List.vue has a problem, the prompt tells me that HelloWorld.md cannot be found, the file actually exists and according to the error it links to an incorrect directory(C:\src\posts\HelloWorld.md).
Possible useful information: I am using Windows 11 and pnpm
Reproduction 🐞
Please provide a link to a repo that can reproduce the problem you ran into.
https://github.com/kecrily/iles-bug-reproduction
Dependencies Info
Run npx iles info and pnpm list (or npm list) and provide the output:
iles v0.7.21 vite v2.7.10
devDependencies:
iles 0.7.21
typescript 4.5.4
vite 2.7.10
vue-tsc 0.29.8
Logs 📜
If not providing a reproduction:
Output
Run DEBUG=iles:* npm run dev or DEBUG=iles:* npm run build and provide the output:
Screenshots 📷
Provide console or browser screenshots of the problem.

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (18 by maintainers)
Fixed in
@islands/pages0.7.8.Thanks again @kecrily for providing detailed error information! Try running
pnpm upgrade, and it should bump the versions automatically.The logs returned by this command are still the same, but the logs that are needed after visiting the page appear. I think the original command worked too, I just didn’t visit the page
Details
Adding
resolve(root, file)here might do the trick.Already using
pathein all internal packages.