-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Failed to load custom reporter if it's inside node_modules
#2459
Comments
Duplicate of #2455 |
Should be fixed in 0.26.6. |
@sheremet-va Thanks for the quick fix! Happy to confirm it's fixed in 0.26.6. |
I may be missing something here, but how do I update to 0.26.6? It isnt in npm (latest there is 0.25.6) and it doesnt seem to be the name of a branch or tag here? I tried updating to 0.25.6 and that did not fix the issue. |
Sorry, I meant 0.25.6. If it doesn't work for you, please provide reproduction. The one in this issue works for me. |
Okay thanks. I'm currently investigating another lead. I'm trying to use vitest with the latest Webstorm, and its there reporter that its trying to load. However I just tried to cat the file (vitest-intellij-reporter-safe.js) that its using, and it doesnt appear to exist... so might be a Webstorm issue after all. |
Okay, the issue appears to be the setting of a "root" in the vite config. I had the root set as the "src" subfolder (in the main vite config, not the test section). When webstorm starts vitest, it passes the path to its reporter as a relative path. It seems like vitest was using the path passed in as relative to the configured root, rather than the working directory, causing it not to find the reporter. Simple reproduction package.json: Then:
interestingly, providing a path relative to the "root" directory (i.e. |
I think this is expected behaviour, because every provided path is relative to root.
This shouldn't fail, and it doesn't fail for me with your reproduction steps. |
This is happening for me in 0.28.4 |
I'm also seeing this in |
Open a separate issue with reproduction. |
Hello there, I was getting the same issue with import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import eslint from "vite-plugin-eslint";
// https://vitejs.dev/config/
export default defineConfig({
- plugins: [react(), eslint()],
+ plugins: [react(), !process.env.VITEST ? eslint() : null],
test: {
globals: true,
environment: "jsdom",
setupFiles: "./src/tests/setup.ts",
},
}); |
I believe this issue may need to be re-opened; with Vitest 0.28.1 the WebStorm custom reporter will not work if your |
Create a new issue with a reproduction, please. I cannot confirm that there is an issue. Make sure your reporter path is set relative to the config root or has the correct absolute path. |
Describe the bug
If a custom reporter is located under
node_modules
and passed using a relative path, it cannot be loaded.Reproduced with vitest 0.25.5
Not reproduced with vitest 0.25.4
Originally reported in WEB-58542. It's a simplified scenario of the initial issue.
Reproduction
touch ./node_modules/my-reporter.js
(create an empty reporter insidenode_modules
)vitest --reporter ./node_modules/my-reporter.js
failsSystem Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: