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

[Bug]: Custom reporter fails to load in Windows #4667

Closed
4 of 11 tasks
gln-gln opened this issue Jul 21, 2023 · 5 comments
Closed
4 of 11 tasks

[Bug]: Custom reporter fails to load in Windows #4667

gln-gln opened this issue Jul 21, 2023 · 5 comments

Comments

@gln-gln
Copy link

gln-gln commented Jul 21, 2023

Info

Kind of Issue

  • runtime - command-line tools

Which Tool or library

  • cspell -- the command-line spelling tool
  • cspell/eslint-plugin -- the plugin for ESLint
  • cspell-tools -- used for building dictionary files
  • cspell-lib -- library that does the actual spell checking.
  • cspell-trie -- tool for working with trie files.

Which Version

Version: cspell v6.31.1

Issue with supporting library?

  • No

OS:

  • Macos
  • Linux
  • Windows
  • Other

version:
Windows 10, Node version v18.16.0

Bug Description

Describe the bug

We are using cspell to check our markdown files. Running cspell on windows with cspell docs/**/*.md *.md --no-progress --show-suggestions results in following error :

ApplicationError: Failed to load reporter C:\Users\..\node_modules\@cspell\cspell-json-reporter\dist\cjs\index.js: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at loadReporter (C:\Users\..\node_modules\cspell\dist\cjs\util\reporters.js:56:19)
    at async Promise.all (index 1)
    at async loadReporters (C:\Users\..\node_modules\cspell\dist\cjs\util\reporters.js:60:29)     
    at async run (C:\Users\..\node_modules\cspell\dist\cjs\lint\lint.js:297:59)
    at async runLint (C:\Users\..\node_modules\cspell\dist\cjs\lint\lint.js:58:24)
    at async Command.parseAsync (C:\Users\..\node_modules\commander\lib\command.js:935:5)
    at async Object.run (C:\Users\..\node_modules\cspell\dist\cjs\app.js:47:5) {
  cause: undefined
}

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any suggestions ?

@Jason3S
Copy link
Collaborator

Jason3S commented Jul 21, 2023

@gowriln,

I'm not able to reproduce this.

It looks like you are using the @cspell/cspell-json-reporter. Did you configure it using a config file? Is so, please include a copy of the CSpell config file.

This is what I see:
image

@pereorga
Copy link

I can reproduce this issue on Windows.

Passing --reporter @cspell/cspell-json-reporter works, but looks like having the reporter set in the configuration produces the error:

    "reporters": ["@cspell/cspell-json-reporter"],

@Jason3S
Copy link
Collaborator

Jason3S commented Jul 25, 2023

Thank you.

I was able to make a test. This seems to only be happening on Windows. At the moment, I don't have access to a Windows machine.

image

Related Test PR: #4678

@Jason3S Jason3S changed the title [Bug]: [Bug]: Custom reporter fails to load in Windows Aug 8, 2023
@Jason3S
Copy link
Collaborator

Jason3S commented Aug 14, 2023

This should be fixed.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants