Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing sources when uri is not just a file #16191

Closed
7 tasks done
userquin opened this issue Mar 18, 2024 · 2 comments
Closed
7 tasks done

missing sources when uri is not just a file #16191

userquin opened this issue Mar 18, 2024 · 2 comments

Comments

@userquin
Copy link
Contributor

userquin commented Mar 18, 2024

Describe the bug

Missing sources warnings when the uri is not a file:

The fix should be easy (import fsPathFromUrl and use it when decoding source path in injectSourcesContent):

// packages/vite/src/node/server/sourcemap.ts
import { blankReplacer, createDebugger, fsPathFromUrl } from '../utils'
...
// L56
let resolvedSourcePath = fsPathFromUrl(decodeURI(sourcePath))

Reproduction

https://stackblitz.com/edit/nuxt-starter-w4dvxu?file=nuxt.config.ts,brand%2Fnuxt.config.ts

Steps to reproduce

The warning on console once dev server started.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 29.27 GB / 63.71 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.4 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (122.0.2365.80)
    Internet Explorer: 11.0.19041.3636

Used Package Manager

npm

Logs

Writing to console the error (L63 and L64 in packages/vite/src/node/server/sourcemap.ts):

[16:15:40]  ERROR  D:\work\issues-repos\unocss-issue-3636\brand\components\dialog\test\Test.vue?nuxt_component=async&nuxt_component_name=DialogTest ENOENT: no such fil
e or directory, open 'D:\work\issues-repos\unocss-issue-3636\brand\components\dialog\test\Test.vue?nuxt_component=async&nuxt_component_name=DialogTest'

Validations

Copy link

stackblitz bot commented Mar 18, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

It reproduced but after adding

"overrides": {
    "vite": "^5.4.0"
  }

the warning didn't happen.

I guess it was fixed somewhere between 5.1.5 and 5.4.3

@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants