-
Notifications
You must be signed in to change notification settings - Fork 189
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
getSourceFiles returning multiple instances of the same file #348
Comments
Hmmm that’s strange. Usually I’m really fast at fixing bugs, but unfortunately I’m moving this week so I’ll take a look sometime next week. |
Hey @crisbeto , just out of curiosity, since I can't reproduce this, could you share the value of someFilePattern and more or less the structure of the current folder ? is it a TypeScript project ? does it have tsconfig.json and package.json files ? what happen if you run it using absolute glob from another folder ? What happens if you add a minimal compilerOptions ? :
Thanks |
It makes sense that it's a recent bug because I did some refactoring in this area recently. I haven't been able to reproduce it though, but I will do a review of the code again soon and I should be able to find the problem. Regardless, I'll submit a change that will cause an error to be throw in case it ends up in this state and that will help us catch this situation. Unfortunately since my move I haven't been able to setup my desktop at home because I'm doing some renovations. Hopefully I'll be able to set it up this weekend and then look into this further. I'm looking forward to getting back to work on this project soon... but my home is a construction site at the moment (getting close to being done). |
I am experiencing the same issue, suddenly 133 files become 135, two files are duplicate. Also, I can confirm that the workaround of selecting source files using |
@crisbeto @dominique-mueller I didn't mean to close this just yet. Since I wasn't able to reproduce this could you see if the latest fix in 12.4.1 resolved this issue? Thanks! Also, sorry for the delay. I finally got my desk setup last night. |
I did upgrade to |
I can also confirm that the issue is fixed. Thank you @dsherret! |
…instances of the same source file. Should do a locale comparison for keeping files in "order" during the binary insert rather than a case insensitive comparison.
I'm sorry for the vague report, but this is part of a larger project and I haven't been able to isolate the issue. I have a setup that looks like this:
In the
console.log
at the end I get an array that has multiple instances of each file (for a 42-file project I get back 663 results), e.g. the array looks like['foo.ts', 'bar.ts', 'foo.ts', 'bar.ts']
. A few notes:ts-simple-ast
would throw an error if I tried to create the file again.10.2.0
to12.4.0
.getSourceFiles
are all pointing to the same object which means that it's probably not creating multiple instances of the same file.getSourceFiles('**/*.ts')
.The text was updated successfully, but these errors were encountered: