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

Whitespace in project path on windows #531

Closed
MauriceChocoSwiss opened this issue Jul 18, 2024 · 11 comments
Closed

Whitespace in project path on windows #531

MauriceChocoSwiss opened this issue Jul 18, 2024 · 11 comments
Labels
upstream Related to an upstream issue

Comments

@MauriceChocoSwiss
Copy link

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
Copy link
Contributor

duowb commented Jul 19, 2024

It may be an error prompted by this package
yyx990803/launch-editor#50

@webfansplz
Copy link
Member

@MauriceChocoSwiss
Copy link
Author

Oh nice 😊 Thank you!

@MauriceChocoSwiss
Copy link
Author

MauriceChocoSwiss commented Jul 23, 2024

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 webfansplz reopened this Jul 24, 2024
@webfansplz
Copy link
Member

Maybe related to yyx990803/launch-editor#50, Can you use "pnpm"."overrides" to help us test it. e.g.

{
  "pnpm": {
    "overrides": {
       "launch-editor-middleware": "2.7.0"
    }
  }
}

@MauriceChocoSwiss
Copy link
Author

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
Copy link
Contributor

duowb commented Jul 24, 2024

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
Copy link
Author

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
Copy link
Member

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

@MauriceChocoSwiss
Copy link
Author

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

@MauriceChocoSwiss
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Related to an upstream issue
Projects
None yet
Development

No branches or pull requests

4 participants