tsconfig-paths icon indicating copy to clipboard operation
tsconfig-paths copied to clipboard

fixed resolve root directory

Open revinsys opened this issue 3 years ago • 5 comments

The bug was found in https://github.com/nestjs/nest/issues/9504. When using the Dockerfile and the root directory in it, the script crashed into an infinite loop

revinsys avatar May 16 '22 04:05 revinsys

@revinsys The issue you are refering to seems to be using 3.9.0. Could you confirm this is a problem with tsconfig-paths 4.0.0? Also adding a test that shows the bug would be great.

jonaskello avatar May 16 '22 05:05 jonaskello

@jonaskello I checked it on version 4, the error persisted (originally it was version 3.14.1) I attached a code example Above, there is a separate repository branch and if you run it through the Dockerfile, this error will occur. The only thing is that initially I suggested the wrong solution. I tried to describe the problem in the test p.s. I don't know how to write tests, don't kick too much

revinsys avatar May 16 '22 09:05 revinsys

in particular, the function getPathsToTry returns for example //src/main.ts and other that does not match the path, and the resolver module tries to call again and again substituting at the beginning of the path / which leads to an infinite loop

revinsys avatar May 16 '22 09:05 revinsys

@aleclarson Would you care to review this one?

jonaskello avatar May 16 '22 17:05 jonaskello

@jonaskello @aleclarson any updates on this?

n10000k avatar Jan 24 '23 12:01 n10000k