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
Internal Error: relativeFrom(....../my-app/node_modules/typescript/lib/lib.d.ts): path is not relative #36777
Comments
Contents of angular-errors.log:
|
I have updated the bug report and the comment below with new info. The bug only occurs in a very specific setup. |
This comment has been minimized.
This comment has been minimized.
I face the same problem (Windows 10): But "C:\Users\myuser\IdeaProjects" is a symlink (created through mklink) to "D:\Workspaces\IdeaProjects" Errors when trying to build the project is:
Environment:
Edit: |
I can reproduce this on my Windows machine. Thanks for the excellent, clear and simple reproduction steps @Hermholtz |
So here is the problem. In our relative<T extends PathString>(from: T, to: T): PathSegment {
return relativeFrom(this.normalize(p.relative(from, to)));
} In the export function isWithinPackage(packagePath: AbsoluteFsPath, filePath: AbsoluteFsPath): boolean {
const relativePath = relative(packagePath, filePath);
return !relativePath.startsWith('..') && !relativePath.startsWith('node_modules/');
} Unfortunately, in this case the two paths are on different drives (i.e. The problem is that |
The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that in some cases we needed to check whether the result is "rooted", i.e and AbsoluteFsPath, rather than a `PathSegment`, before using it. Fixes angular#36777
The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that in some cases we needed to check whether the result is "rooted", i.e and AbsoluteFsPath, rather than a `PathSegment`, before using it. Fixes angular#36777
The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that now, in some cases, we needed to check whether the result is "rooted", i.e an `AbsoluteFsPath`, rather than a `PathSegment`, before using it. Fixes angular#36777
…ngular#37959) The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that now, in some cases, we needed to check whether the result is "rooted", i.e an `AbsoluteFsPath`, rather than a `PathSegment`, before using it. Fixes angular#36777 PR Close angular#37959
The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that now, in some cases, we needed to check whether the result is "rooted", i.e an `AbsoluteFsPath`, rather than a `PathSegment`, before using it. Fixes angular#36777
The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that now, in some cases, we needed to check whether the result is "rooted", i.e an `AbsoluteFsPath`, rather than a `PathSegment`, before using it. Fixes angular#36777
…38030) The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that now, in some cases, we needed to check whether the result is "rooted", i.e an `AbsoluteFsPath`, rather than a `PathSegment`, before using it. Fixes #36777 PR Close #38030
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ngular#37959) The `fs.relative()` method assumed that the file-system is a single tree, which is not the case in Windows, where you can have multiple drives, e.g. `C:`, `D:` etc. This commit changes `fs.relative()` so that it no longer forces the result to be a `PathSegment` and then flows that refactoring through the rest of the compiler-cli (and ngcc). The main difference is that now, in some cases, we needed to check whether the result is "rooted", i.e an `AbsoluteFsPath`, rather than a `PathSegment`, before using it. Fixes angular#36777 PR Close angular#37959
🐞 Angular app does not build or start on Windows
This error occurs when doing the build from a symlinked directory on Windows, when the physical (original) directory is on the different drive letter than the symlink.
The purpose of this symlink is to overcome shortages of disk space on c: drive, but work as if everything is on c: under the user's home directory, as usual.
Is this a regression?
No.
🔬 Minimal Reproduction
Open command prompt as admin (will need to create a symbolic directory link).
d:\test is the directory in which files reside.
c:\testlink is the symlink to the above.
or the last step:
🔥 Exception or Error
Notice that all paths in dump below are pointing to the physical directory
d:\test\my-app
, whereas the build was launched fromc:\testlink\my-app
. The difference is in the drive letter.🌍 Your Environment
Angular Version:
Additional info
I think it won't ever happen on Mac and Linux where there's a single filesystem tree.
The text was updated successfully, but these errors were encountered: