-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Vite 6: The "path" argument must be of type string. Received an instance of RegExp #18875
Comments
It seems this is a bug in jest. This line is returning false when test("Minimal", async () => {
const defaultExclude = /node_modules/;
expect(defaultExclude instanceof RegExp).toBe(true); // ok
expect(structuredClone(defaultExclude) instanceof RegExp).toBe(true); // error
}); This is the minimal reproduction case. Maybe jestjs/jest#2549? I'm open to changing this line to vite/packages/vite/src/node/utils.ts Line 1097 in 20fdf21
I guess this would avoid the error happening. BTW it seems the test above works with Vitest. |
Thanks, I tried to open a specific issue in jest as the one you linked seems to be about a much more general behaviour. Let's see if that yields anything |
I'll close this issue for now as this isn't a bug in Vite. But I'm still open to changing the line mentioned above, so if someone is interested, feel free to open a PR that changes the line. |
Describe the bug
Hi,
I'm trying to update my plugin to Vite v6 (marekdedic/rollup-plugin-htaccess#170), however, I'm encoutering issues with my tests on Vite 6.
Reproduction
https://github.com/marekdedic/vite-6-path-issue-repro
Steps to reproduce
npm ci
npm test
System Info
System: OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat) CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1265U Memory: 6.57 GB / 15.23 GB Container: Yes Shell: 5.9 - /usr/bin/zsh Binaries: Node: 22.11.0 - /usr/bin/node Yarn: 1.22.21 - /usr/bin/yarn npm: 10.9.1 - /usr/bin/npm npmPackages: vite: ^6.0.2 => 6.0.2
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: