-
Notifications
You must be signed in to change notification settings - Fork 201
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
Adding .d.ts
files into project no longer works in v24
#1593
Comments
A bit more details about this, tried logging the inputs here:
With
Also when I do
So far I cannot make it fail this way in the ORM test suite itself, I can only see this inside the docker image. When I downgrade ts-morph to v23 inside it, the same logs are correctly adding the files to the project:
|
It's weird. I think I'm just going to revert that PR. I'd rather have stability. |
Sorry for the breakage. I believe this issue was just fixed in Definitely agree that correctness is more important than size and speed. Hopefully we can achieve both here though. I'd love if we could try the next version of
|
I tried to apply the patch locally and it did not help with this issue. Logging the |
Released now in 25.0.0. Let's re-evaluate this once the issue is actually fixed. |
Describe the bug
Version: 24.0.0
To Reproduce
We use ts-morph inside MikroORM to allow inference of property types from TS files. In production environment, we used
.d.ts
files instead of.ts
to do this. This is the part that adds the files to the project:https://github.com/mikro-orm/mikro-orm/blob/master/packages/reflection/src/TsMorphMetadataProvider.ts#L245
A complete reproduction for this problem is provided in mikro-orm/mikro-orm#6297, I can try to narrow it down if that's not enough. Reverting ts-morph to v23 resolves the problem.
I've started debugging this from inside the docker container, and I can see that when we try to add the
.d.ts
files into the project viathis.sources = this.project.addSourceFilesAtPaths(paths)
, it's apparently a no-op, since callingconsole.log(this.sources.map(s => s.getFilePath()))
gave me an empty array.The inputs for
addSourceFilesAtPaths
are as follows:I verified all the files are present on those paths inside the container. The app is in the root of the container. Note that the error message you can see when you run that app says the
.ts
file was not found, but internally we check both.ts
and.d.ts
files, and only report the former, so it's not about that.I hope this can be enough for you since all the ts-morph handling is part of that single
TsMorphMetadataProvider
class (which is fairly simple), but I can surely try to reproduce this without the ORM involved too.Expected behavior
Same behavior as v23,
.d.ts
files should be added to the project.My hunch is it was caused by #1558. I tried to update TS to 5.6 and 5.7 in that project and that itself didn't help.
The text was updated successfully, but these errors were encountered: