-
Notifications
You must be signed in to change notification settings - Fork 477
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
Adapt relative paths resolution to tsconfig outDir depth #2706
Comments
Removing one of these two statements fixes the issue, but I fail to understand the whole context at the moment: swagger/lib/plugin/utils/plugin-utils.ts Lines 153 to 155 in c4cbca6
swagger/lib/plugin/utils/plugin-utils.ts Line 192 in c4cbca6
|
@kamilmysliwiec We're also facing this issue. We have a schemas package that's used in our frontends and backends. Until this is fixed, our only options are:
|
This is a clear bug and I don't know why this PR was closed without any comment. @aqeelat - can you give an example of the second option? (I'm trying to add paths to my tsconfig but can't figure it out) |
Ok -- I tried to hack on it a bit but I'm not super familiar with the typescript / AST APIs. So it seems that this code is trying to resolve the path relative to the source file instead of the destination file. Anyways, I'm wondering why it's trying to resolve the paths anyways as there is already an import expression in the file for the node. Is there any reason why we can't just clone the existing node? I already time-boxed trying to come up with a solution (spent all yesterday) otherwise I'd open a PR going down that route but I think this is the right path forward and would allow us to get rid of a lot of code related to resolving the paths. |
Sorry @jkalberer, I just saw your mention. We didn’t touch tsconfig. We cd’ed into the src folder and ran something like You might face issues when you have different linting/formatting rules. |
Is there an existing issue for this?
Current behavior
This issue is almost a duplicate of #2114, I can't figure out why this should be address in Discord since it is a real bug and we are facing exactly the same issue in a pnpm workspace.
I can get it working by performing this manual change on dist:
apps/nest/dist/src/app.controller.js
require("../../../packages/math-helpers/dist/index").Me
torequire("../../../../packages/math-helpers/dist/index").Me
Possible related issues:
#1386
#501
Minimum reproduction code
https://github.com/bindermuehle/monorepo-issue
Steps to reproduce
npm i
npm run start:dev -w nest
Expected behavior
nest/swagger should correctly resolve the paths
Package version
7.1.10
NestJS version
9.0.0
Node.js version
20.9.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: