Skip to content

Windows file path UnescapedBackslashError #10380

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

Open
Girish-Kumar-Amanchi opened this issue May 15, 2025 · 1 comment
Open

Windows file path UnescapedBackslashError #10380

Girish-Kumar-Amanchi opened this issue May 15, 2025 · 1 comment

Comments

@Girish-Kumar-Amanchi
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @rspack/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@rspack/core/compiled/watchpack/index.js b/node_modules/@rspack/core/compiled/watchpack/index.js
index d6de72a..e4b2bc0 100644
--- a/node_modules/@rspack/core/compiled/watchpack/index.js
+++ b/node_modules/@rspack/core/compiled/watchpack/index.js
@@ -9,7 +9,7 @@ module.exports = function (glob, opts) {
     throw new TypeError('Expected a string');
   }
 
-  var str = String(glob);
+  var str = String(glob).replace(/\\/g, '/');
 
   // The regexp we are building, as a string.
   var reStr = "";

This issue body was partially generated by patch-package.

@Lunigorn
Copy link

Works like a charm!

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

No branches or pull requests

2 participants