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

ERR_INVALID_ARG_TYPE when trying to add to local dictionary #39

Open
kript opened this issue Jun 7, 2022 · 1 comment
Open

ERR_INVALID_ARG_TYPE when trying to add to local dictionary #39

kript opened this issue Jun 7, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@kript
Copy link

kript commented Jun 7, 2022

Describe the bug

When running gramma against a markdown file using en-GB language, a new word is found.
Attempting to add it to the dictionary causes an npm error.
New files can be created in users home directory and in current working directory.

To Reproduce

gramma check -m -l "en-GB" Lessons.md
Language: English (GB)
Resolved: 0 | Pending: 12
---------------------------------

Rule: typos
Explanation: Possible spelling mistake found.

Context: # Lessons  1. [What is iRODS?](https://github.com/metadata-school/In...
Suggested fix: 1) rods  2) irons  3) iPods  4) prods

---------------------------------
? What do you want to do?
Enter: default (1)
1-4: choose fix
0: custom fix
i: ignore
l: add to local dictionary
g: add to global dictionary
n: next
 › l
node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at Object.openSync (node:fs:577:10)
    at Object.openSync (pkg/prelude/bootstrap.js:739:32)
    at Object.writeFileSync (node:fs:2153:35)
    at configure (/snapshot/gramma/src/actions/configure.js:87:6)
    at checkInteractively (/snapshot/gramma/src/actions/checkInteractively.js:50:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async check (/snapshot/gramma/src/commands/check.js:32:31) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Expected behavior

New word is added to the local dictionary.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 LTS run in WSL.
  • Gramma Version: 1.6.0
@kript kript added the bug Something isn't working label Jun 7, 2022
@kript
Copy link
Author

kript commented Jun 26, 2022

I have just discovered that this occurs when gramma init has not been run first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants