question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`useDocuments` paths are incorrectly resolved in Windows

See original GitHub issue

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.

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
ElMassimocommented, Jan 21, 2022

Fixed in @islands/pages 0.7.8.

Thanks again @kecrily for providing detailed error information! Try running pnpm upgrade, and it should bump the versions automatically.

1reaction
kecrilycommented, Jan 7, 2022

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
iles:pages:gen routes: [
  iles:pages:gen   {
  iles:pages:gen     name: 'index',
  iles:pages:gen     path: '/',
  iles:pages:gen     frontmatter: { layout: undefined, meta: [Object], route: {} },
  iles:pages:gen     componentFilename: 'C:/Users/kecrily/Desktop/dev/iles-bug-reproduction/src/pages/index.mdx'
  iles:pages:gen   },
  iles:pages:gen   {
  iles:pages:gen     name: 'about',
  iles:pages:gen     path: '/about',
  iles:pages:gen     frontmatter: { layout: undefined, meta: [Object], route: {}, title: 'About' },
  iles:pages:gen     componentFilename: 'C:/Users/kecrily/Desktop/dev/iles-bug-reproduction/src/pages/about.md'       
  iles:pages:gen   },
  iles:pages:gen   {
  iles:pages:gen     path: '/:zzz(.*)*',
  iles:pages:gen     name: 'NotFoundInDev',
  iles:pages:gen     componentFilename: '@islands/components/NotFound'
  iles:pages:gen   }
  iles:pages:gen ] +0ms
8:57:01 [vite] ENOENT: no such file or directory, stat 'C:\src\posts\HelloWorld.md'
  iles:documents ~/posts {
  iles:documents   path: 'src/posts',
  iles:documents   pattern: 'src/posts/**/*.{md,mdx}',
  iles:documents   files: [ 'src/posts/HelloWorld.md' ]
  iles:documents } +0ms
8:57:02 [vite] ENOENT: no such file or directory, stat 'C:\src\posts\HelloWorld.md' (x2)
  iles:documents ~/posts {
  iles:documents   path: 'src/posts',
  iles:documents   pattern: 'src/posts/**/*.{md,mdx}',
  iles:documents   files: [ 'src/posts/HelloWorld.md' ]
  iles:documents } +662ms
Read more comments on GitHub >

github_iconTop Results From Across the Web

I messed up my foldetr paths and i can't fix it
In the folders that are displaying the wrong name: Open the folder; Shift+right-click in the background & select 'Open PowerShell window here' ...
Read more >
Use component documents in AWSTOE - EC2 Image Builder
Use YAML component documents with AWS Task Orchestrator and Executor to create components that you can use with AWS services to build AMIs...
Read more >
How the do I exactly fix the userpath bug?
Was anybody here able to fix that bug where beamng drive is using a different userpath? So far it feels like im literally...
Read more >
Can't use relative paths in url() in scss files #12797 - GitHub
I know this is solved by using an absolute path for the image. ... The problem with that is that I can't change...
Read more >
TeraCopy - Code Sector Blog
Use Documents folder for reports. ... Warn when Explorer passes the cropped path to TeraCopy. ... Fixed: incorrect total size formatting for some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found