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

reporters.filter is not a function #105

Closed
gajus opened this issue Mar 29, 2023 · 2 comments
Closed

reporters.filter is not a function #105

gajus opened this issue Mar 29, 2023 · 2 comments

Comments

@gajus
Copy link

gajus commented Mar 29, 2023

New install, unsure what is broken, but getting error:

Analyzing workspace (packages/temporary-common)...
file:https:///Users/gajus/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/knip/dist/plugins/vitest/helpers.js:25
    return reporters ? reporters.filter(reporter => !builtInReporters.includes(reporter)) : [];
                                 ^

TypeError: reporters.filter is not a function

I added console.log to getExternalReporters to see what is the value of reporters and it prints:

{ reporters: 'verbose' }

Our configuration:

import { type KnipConfig } from 'knip';

const Knip: KnipConfig = {
  "ignoreWorkspaces": ["apps/*"],
  "workspaces": {
    "packages/*": {
      "ignore": [
        "**/*.d.ts"
      ],
      "entry": [
        "src/index.ts!"
      ],
      "project": [
        "src/**/*.ts!"
      ]
    },
  }
};

export default Knip;
@webpro webpro closed this as completed in 5643893 Mar 30, 2023
@webpro
Copy link
Collaborator

webpro commented Mar 30, 2023

Ah, reporters can be a string too, should be fixed in v2.2.3.

@webpro
Copy link
Collaborator

webpro commented Mar 30, 2023

By the way, I can see this project has vitest and that configuration (e.g. vitest.config.js) has { reporters: 'verbose' }

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