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

'utf-8' codec can't decode #112

Closed
paul-gauthier opened this issue Jul 16, 2023 · 5 comments
Closed

'utf-8' codec can't decode #112

paul-gauthier opened this issue Jul 16, 2023 · 5 comments

Comments

@paul-gauthier
Copy link
Collaborator

          mypath.../node_modules/faker/lib/locales/it/name/first_name.js: 'utf-8' codec can't

decode byte 0xf9 in position 5170: invalid start byte

Is there anyway to have Aider ignore node_modules?

I'm not sure if this issue is related, but I've already tried upgrading Aider.

It also seems to hang.

du -sh .aider.*
12K .aider.chat.history.md
27M .aider.ident.cache.v1
4.0K .aider.input.history
166M .aider.tags.cache.v1
(AI-CODING-ENV) neo@tulum  ~/Documents/Business/SmallCloud/git/ec-app-frontend   main ±  wc -l .aider.tags.cache.v1
wc: .aider.tags.cache.v1: read: Is a directory
(AI-CODING-ENV) ✘ neo@tulum  ~/Documents/Business/SmallCloud/git/ec-app-frontend   main ±  ls .aider.tags.cache.v1
00 13 26 38 4c 5e 70 84 9a b1 c2 d3 e5 fa
01 14 27 39 4d 5f 71 86 9d b2 c3 d4 e6 fb
02 15 28 3a 4e 60 72 87 9e b3 c4 d6 e7 fc
03 16 29 3b 4f 61 73 88 9f b4 c5 d7 e8 fd
04 17 2b 3d 50 62 74 89 a0 b5 c6 d8 e9 fe
05 18 2c 3e 51 63 75 8b a1 b6 c7 d9 ea
07 19 2d 3f 52 64 76 8c a2 b7 c8 da ec
08 1a 2e 41 53 65 78 8d a4 b8 c9 db ef
09 1b 2f 42 54 66 79 8e a5 b9 ca dc f0
0a 1c 30 43 56 67 7a 8f a7 ba cache.db dd f1
0b 1d 31 44 57 68 7c 91 a8 bb cb de f2
0c 1e 32 46 58 69 7e 94 a9 bc cc df f3
0d 1f 33 47 59 6a 7f 95 aa bd cd e0 f4
0e 21 34 48 5a 6b 80 96 ab be ce e1 f6
0f 22 35 49 5b 6c 81 97 ac bf d0 e2 f7
10 23 36 4a 5c 6e 82 98 ae c0 d1 e3 f8
12 25 37 4b 5d 6f 83 99 af c1 d2 e4 f9

My project is 241M if I include Aiders 166M cache (so far).... it may have been caching things, but i'm not sure. It seems to be hanging....

Originally posted by @funkytaco in #56 (comment)

@paul-gauthier
Copy link
Collaborator Author

Thanks for trying aider and reporting this issue. You seem to have 2 issues going on here:

Aider is scanning all of your node_modules directory.

Aider scans all the files in your git repo once, and then re-scans any files which are modified.

Have you added node_modules and all of its content to your git repo? Normally folks do not do that. If it is in your repo, that would explain why aider trying to scan all of those files.

Aider is encountering lots of non-utf8 files.

Aider prints a warning message if it encounters a file which does not match the encoding it is using. The warnings are harmless as long as those files aren't important to the work you want to do with GPT. Aider will remember that the file can't be decoded and ignore it.

Or, if all your files are in a non-utf8 encoding, you can specify it with the --encoding command line switch.

@funkytaco
Copy link

So are you saying to add node_modules to .gitignore?

Anyhow, I tried on an empty project and it's working really well with React. This project is stellar.

@paul-gauthier
Copy link
Collaborator Author

Yes, node_modules is usually added to .gitignore.

But it looks like those files have already been added to your git repo? If so you will also need to remove them. You should see if git rm --cached node_modules would do what you want. But please confirm and understand any risks of using that command before running it.

@paul-gauthier
Copy link
Collaborator Author

I'm going to close this issue for now, but feel free to re-open or file a new issue any time.

@alexturpin
Copy link

@paul-gauthier I'm running into this in a repo with lots of committed, non code files (e.g. PDFs). I understand that it's harmless but the warning still causes a big wall of red whenever Aider first tries to help! Just wanted to add my use case out here, maybe there's a world where we can have a flag to silence this? Would be happy to contribute.

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

3 participants