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

compilerOptions.paths not relative to ts config file on extends #10

Closed
Chocobozzz opened this issue Jan 4, 2022 · 5 comments · Fixed by #26
Closed

compilerOptions.paths not relative to ts config file on extends #10

Chocobozzz opened this issue Jan 4, 2022 · 5 comments · Fixed by #26
Assignees
Labels
bug Something isn't working

Comments

@Chocobozzz
Copy link
Contributor

Hi,

resolve-tspaths correctly handles tsconfig extends, but does not resolve compilerOptions.paths from tsconfig where it was defined. It means that paths are resolved from the main tsconfig file resulting in invalid path resolution.

@benyap benyap self-assigned this Jan 5, 2022
@benyap benyap added the bug Something isn't working label Jan 5, 2022
@benyap
Copy link
Owner

benyap commented Jan 8, 2022

Thanks for the issue @Chocobozzz. Could you provide a bit more detail, such as what the current behaviour is vs the expected behaviour?

@Chocobozzz
Copy link
Contributor Author

Sure!

We have a tsconfig file defined in server/tools directory extending another one that is at the root of the repository. The parent tsconfig defines paths: https://github.com/Chocobozzz/PeerTube/blob/develop/tsconfig.json#L7. The server/tools tsconfig also defines paths because of this bug, but it should not.

resolve-tspaths correctly merge these tsconfig files, but then resolve paths property paths from server/tools. Since the paths property were defined in the root tsconfig, they should be resolved from the root of the repository.

@benyap
Copy link
Owner

benyap commented Jan 21, 2022

I see, that makes sense. Will look into this and hopefully have a fix soon :)

@benyap
Copy link
Owner

benyap commented Jan 21, 2022

@all-contributors add @Chocobozzz for bug report

@allcontributors
Copy link
Contributor

@benyap

I've put up a pull request to add @Chocobozzz! 🎉

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

Successfully merging a pull request may close this issue.

2 participants