Skip to content

fix: decode diagnostic file URLs before reading sources - #821

Closed
charan-rathore wants to merge 1 commit into
fi3ework:mainfrom
charan-rathore:fix/decode-file-url-diagnostics
Closed

charan-rathore wants to merge 1 commit into
fi3ework:mainfrom
charan-rathore:fix/decode-file-url-diagnostics

Conversation

@charan-rathore

Copy link
Copy Markdown

Description

normalizePath supports diagnostic filenames starting with file://, but currently removes the prefix without decoding the URL. A filename such as a space.ts becomes a%20space.ts. readSources cannot find that file, so its diagnostics are silently dropped. Percent signs, hashes, and non-ASCII names have the same problem.

Use Node's fileURLToPath to convert the URL to a real filesystem path, including percent decoding and platform-specific path handling. Ordinary relative and absolute paths keep their existing behavior.

The tests create real files, turn their names into file URLs, normalize them, and read their contents through readSources. All four encoded-name cases fail before this change and pass after it. A plain-path control checks that literal percent sequences in non-URL filenames are not decoded.

This completes the file-URL support discussed in #679; it does not alter the checker command or spawn handling.

Validation: all 46 unit tests, package typecheck, build, and changed-file Biome checks pass. Full repository lint has a pre-existing formatting error in untouched utils.spec.ts.

@netlify

netlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vite-plugin-checker ready!

Name Link
🔨 Latest commit a5c4b9d
🔍 Latest deploy log https://app.netlify.com/projects/vite-plugin-checker/deploys/6abddc50e341720008671680
😎 Deploy Preview https://deploy-preview-821--vite-plugin-checker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vite-plugin-checker@821

commit: a5c4b9d

@charan-rathore

Copy link
Copy Markdown
Author

Closing this since there has been no movement on it. Happy to reopen and pick it back up if there is interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant