devtools-next icon indicating copy to clipboard operation
devtools-next copied to clipboard

Whitespace in project path on windows

Open MauriceChocoSwiss opened this issue 1 year ago • 10 comments

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 :)

MauriceChocoSwiss avatar Jul 18 '24 14:07 MauriceChocoSwiss

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

duowb avatar Jul 19 '24 10:07 duowb

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

webfansplz avatar Jul 22 '24 04:07 webfansplz

Oh nice 😊 Thank you!

MauriceChocoSwiss avatar Jul 22 '24 06:07 MauriceChocoSwiss

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 ?

MauriceChocoSwiss avatar Jul 23 '24 23:07 MauriceChocoSwiss

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"
    }
  }
}

webfansplz avatar Jul 24 '24 04:07 webfansplz

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" } }

MauriceChocoSwiss avatar Jul 24 '24 06:07 MauriceChocoSwiss

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

duowb avatar Jul 24 '24 08:07 duowb

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..

MauriceChocoSwiss avatar Jul 24 '24 08:07 MauriceChocoSwiss

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

alexzhang1030 avatar Jul 25 '24 01:07 alexzhang1030

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

MauriceChocoSwiss avatar Aug 05 '24 18:08 MauriceChocoSwiss

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

MauriceChocoSwiss avatar Aug 26 '24 06:08 MauriceChocoSwiss