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]: Failed to resolve file /node_modules/@cspell/dict-aws/cspell-ext.json #5334

Closed
1 task done
recallwei opened this issue Mar 1, 2024 · 14 comments
Closed
1 task done

Comments

@recallwei
Copy link

Kind of Issue

Crash / Error

Tool or Library

cspell

Version

8.5.0

Supporting Library

Not sure / None

OS

macOS

OS Version

14.3.1

Description

I made sure the dependencies were installed. And after that, seems missing @cspell/dict-aws/cspell-ext.json.

> cspell --no-progress --show-suggestions --show-context **

Configuration Error: Failed to resolve file: "/Users/raipiot/Code/raipiot-infra/node_modules/@cspell/dict-aws/cspell-ext.json"
CSpell: Files checked: 8, Issues found: 0 in 0 files
 ELIFECYCLE  Command failed with exit code 1.

Steps to Reproduce

run cspell --no-progress --show-suggestions --show-context **

Expected Behavior

No response

Additional Information

My project is based on pnpm workspace monorepo.

cspell.json

{
  "id": "raipiot",
  "name": "raipiot",
  "readonly": true,
  "allowCompoundWords": true,
  "enableFiletypes": ["astro"],
  "dictionaryDefinitions": [
    {
      "name": "raipiot",
      "path": "./dict/raipiot.txt",
      "description": "raipiot CSpell 通用字典。"
    }
  ],
  "dictionaries": [],
  "languageSettings": [
    {
      "languageId": "*",
      "locale": "*",
      "includeRegExpList": [],
      "ignoreRegExpList": [],
      "patterns": [],
      "dictionaries": ["raipiot"],
      "dictionaryDefinitions": []
    }
  ],
  "ignorePaths": [
    ".github/workflows/**",
    ".vscode/*.json",
    "**/.vercel",
    "**/dist/**",
    "**/build/**",
    "**/node_modules/**",
    "**/public/**",
    "**/assets/**",
    "**/CHANGELOG.md",
    "**/CONTRIBUTORS.md",
    "**/pnpm-lock.yaml",
    "**/README.md",
    "**/tsconfig.tsbuildinfo",
    "**/.bundle/**",
    "**/ios/**",
    "**/android/**",
    "**/vendor/**",
    "**/patches/**",
    "**/storybook-static/**",
    "**/src-tauri/icons/**",
    "**/src-tauri/target/**",
    "**/Cargo.lock",
    "**/Cargo.toml",
    "**/coverage/**",
    "**/stats.html"
  ]
}

cspell.config.yaml

No response

Example Repository

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@recallwei
Copy link
Author

After I install the @cspell/dict-aws, it works again. Does this should be a necessary behaviour?

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 1, 2024

@recallwei,

Thank you for looking into this. The behavior you have seen should not happen. Given that, there was an GitHub outage about the time of the 8.5.0 release today. It is possible that it took a long time for all the packages to get loaded on npmjs.

Please try and uninstall and re-install and see if it is still an issue.

I tried a clean install on a new version of node and it worked fine.

@recallwei
Copy link
Author

I tried reinstalling several times but found that the @cspell dir did not seem to be installed in the root node_modules of my monorepo project

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 2, 2024

@recallwei,

That is frustrating. It feels like you have different versions of CSpell installed.

Please try:

cspell -V
cspell trace --dictionary-path=full aws 
pnpm cspell -V
pnpm cspell trace --dictionary-path=full aws 

The trace command looks up the word aws in all the dictionaries and shows the result.

This is what I see:
image

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 2, 2024

@recallwei,

Did you happen to run cspell link at any point? That command will write a link to CSpell's global config. When running cspell, the first thing it does is load the global config. The links are stored as absolute paths.

The global config is stored at ~/.config/configstore/cspell.json.

@recallwei
Copy link
Author

recallwei commented Mar 2, 2024

@Jason3S

I never ran cspell link on my machine even I didn't know this command.

image image

Should I remove them from the import list?

@recallwei
Copy link
Author

recallwei commented Mar 2, 2024

After I remove them from the global config.

image

It seems to work.

image

@Jason3S Thanks a lot, you save me on the weekend!

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 2, 2024

@recallwei,

I'm happy that was the issue. You can just delete the file. If you have a config sync app, it might have been copied over.

@mcgradycchen
Copy link

mcgradycchen commented Mar 4, 2024

Hi @Jason3S is there any way to ignore the configuration loading error instead of removing the imported path which are not existing ?

It seems the Code Spell Checker in vs code can do that.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 4, 2024

@mcgradycchen,

It would require a new command line option.

Can you explain why the option is needed? If the error reporting was better, I believe the @recallwei's configuration issue would have been quickly fixed.

The extension tries its best to keep working even when there are configuration errors, the is to allowed someone to edit the configuration.

@mcgradycchen
Copy link

Hi @Jason3S ,

I think keep working is also very important for cspell command line.
It is friendly to provide a no strict mode that skip the configuration error and give warning messages rather than block the command runing.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 5, 2024

@mcgradycchen,

In 8.6.0, if you use the option --no-exit-code it will only report the error, but won't stop the processing.

@mcgradycchen
Copy link

Hi @Jason3S

It's great. I see the commit. Thanks for your hard work.

Copy link
Contributor

github-actions bot commented Apr 7, 2024

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 Apr 7, 2024
This issue was closed.
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