vite-plugin-svelte: Could not open +page.svelte in the editor

Describe the bug

Randomly started getting this error on my Svelte projects recently when using the code inspector to open up files. Have no idea how to resolve. It only affects files with special characters in the name.

Could not open +page.svelte in the editor.

When running on Windows, file names are checked against a safe file name pattern to protect against remote code execution attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, slashes, and underscores.

Reproduction URL

https://github.com/sveltejs/vite-plugin-svelte/issues/new

Reproduction

Sorry, do not know how to replicate. Looking for advice on how to fix.

Logs

No response

System Info

Windows 11, VS Code, Tested with Brave and Edge

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 24 (12 by maintainers)

Most upvoted comments

oof, [] and () are problems tooo i guess

caused by https://github.com/yyx990803/launch-editor/commit/5366f3ee3addc9ea014088c254db6398f788fbff

launch-editor tries to protect from malicious filenames, not sure if + is a dangerous char on windoes or just too rigid check

The fix is in launch-editor 2.9.1 which has been merged into vite main branch (6.0 beta) but not backported to 5.4 branch yet, sorry. still needs to wait a bit

latest version of launch-editor and vite should have this fixed. if you still experience files that do not open please share their full path (skip your user dir for privacy if you prefer but mention if it has any special chars)

So I am running VSCode 1.94.0 and vite 5.4.8. Maybe its the underscore in my repo name? Unbenannt

can confirm this is still an issue with vite 5.4.2

Could not open Title.svelte in the editor.

When running on Windows, file names are checked against a safe file name pattern 
to protect against remote code execution attacks. File names may consist only of 
alphanumeric characters (all languages), periods, dashes, slashes, and underscores.

image


Referencing

issue: https://github.com/yyx990803/launch-editor/issues/50 pull: https://github.com/yyx990803/launch-editor/issues/50 commit: https://github.com/yyx990803/launch-editor/commit/5366f3ee3addc9ea014088c254db6398f788fbff

This is the path to one of my pages. Closest character to a special character is the underscore. Unbenannt

the fix for this is going to be included in the next release of vite

fix could take a bit as launch-editor is bundled in vite