vuejs / devtools

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools.vuejs.org/
MIT License
1.7k stars 122 forks source link

Whitespace in project path on windows #531

Closed MauriceChocoSwiss closed 2 months ago

MauriceChocoSwiss commented 4 months ago

Hi, I've just created a new Vue project with the vue-create and I've select the option to add devtools.

I've tried to use the devtools to test it but evry time I click on a component to see it in my editor (Idea), i've a error message about files name on Windows. (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.)

After many tests, I've found the problem is a whitespace in my path (my repos folder as one), if i create a project in a non-whithspace path, it work like a charm.

I've check really quickly if I found something in the code here but I didn't found anything yet. Maybe someone more familliar with this tool can check this :)

duowb commented 4 months ago

It may be an error prompted by this package https://github.com/yyx990803/launch-editor/issues/50

webfansplz commented 4 months ago

https://github.com/webfansplz/vite-plugin-vue-inspector/pull/100

MauriceChocoSwiss commented 4 months ago

Oh nice 😊 Thank you!

MauriceChocoSwiss commented 4 months ago

Hi, i've just update my project with the new version, unfortunately, it doesn't work for me... I've made few more test, but when the path got a whitespace , it wont work... The URL was correct where you update the code => http://localhost:5173/__open-in-editor?file=src/App.vue:7:9. MAybe related to lauchEditor ?

webfansplz commented 4 months ago

Maybe related to https://github.com/yyx990803/launch-editor/issues/50, Can you use "pnpm"."overrides" to help us test it. e.g.

{
  "pnpm": {
    "overrides": {
       "launch-editor-middleware": "2.7.0"
    }
  }
}
MauriceChocoSwiss commented 4 months ago

I use yarn but I've installed pnpm to test your override but it doesn't work with this in package.json. I've also try "overrides": { "vite-plugin-vue-devtools": { "launch-editor-middleware": "2.7.0" } }

duowb commented 4 months ago

It's because the regularization check here doesn't pass.

https://github.com/yyx990803/launch-editor/blob/master/packages/launch-editor/index.js#L110

/^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u.test('D://code//my//test//vue devtools//vue project//src//App.vue')
// false
/^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u.test('D://code//my//test//vuedevtools//vueproject//src//App.vue')
// true
MauriceChocoSwiss commented 4 months ago

Ok, yes it miss a \s in second authorized char set. I've made a PR, will see if the author add it or not ^^ There was many old PR that just wait without any comment from author..

alexzhang1030 commented 4 months ago

If we resolve #522 ,do we need launch-editor middleware in the future?

MauriceChocoSwiss commented 3 months ago

My PR on laucnh-editor was merged today and the author made a new release for it !

MauriceChocoSwiss commented 2 months ago

Hi, it worked now ! I'll close this issue