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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: path ... is a file when running ng update @angular/material #22919
Comments
@devversion it looks like our schematic code is trying to process something inside the |
Do you have a snippet showing how the external style is referenced in the |
I've looked more into it. This seems related to b8b3923. The Angular devkit calls Something I find surprising though: Why does TypeScript try to resolve your stylesheet path in |
TypeScript resolves modules using a rather complicated module resolution algorithm. The algorithm tries various paths to determine a possible entry-point for a module. e.g. it also respects a containing `package.json` file, or respects the closest `node_modules` parent directory. In some situations, TypeScript could end up trying a path where a parent directory segment resolves to an existent file. e.g. consider the following directory structure: ``` node_modules/my-pkg/package.json node_modules/my-pkg/styles.css ``` TypeScript could end up trying a path like: `node_modules/my-pkg/styles.css/package.json` or `node_modules/my-pkg/styles.css/a/b/package.json`. This depends on how the module resolution executes, and how the module is referenced. In the example above though, TypeScript checks if the files exist. Our update logic delegates this check to our virtual file system. The virtual file system currently would throw an error by accident as it walks up the path and discovers that `styles.css` is not a directory, _but_ a file. This results in an error as seen in angular#22919.
TypeScript resolves modules using a rather complicated module resolution algorithm. The algorithm tries various paths to determine a possible entry-point for a module. e.g. it also respects a containing `package.json` file, or respects the closest `node_modules` parent directory. In some situations, TypeScript could end up trying a path where a parent directory segment resolves to an existent file. e.g. consider the following directory structure: ``` node_modules/my-pkg/package.json node_modules/my-pkg/styles.css ``` TypeScript could end up trying a path like: `node_modules/my-pkg/styles.css/package.json` or `node_modules/my-pkg/styles.css/a/b/package.json`. This depends on how the module resolution executes, and how the module is referenced. In the example above though, TypeScript checks if the files exist. Our update logic delegates this check to our virtual file system. The virtual file system currently would throw an error by accident as it walks up the path and discovers that `styles.css` is not a directory, _but_ a file. This results in an error as seen in angular#22919. Fixes angular#22919.
TypeScript resolves modules using a rather complicated module resolution algorithm. The algorithm tries various paths to determine a possible entry-point for a module. e.g. it also respects a containing `package.json` file, or respects the closest `node_modules` parent directory. In some situations, TypeScript could end up trying a path where a parent directory segment resolves to an existent file. e.g. consider the following directory structure: ``` node_modules/my-pkg/package.json node_modules/my-pkg/styles.css ``` TypeScript could end up trying a path like: `node_modules/my-pkg/styles.css/package.json` or `node_modules/my-pkg/styles.css/a/b/package.json`. This depends on how the module resolution executes, and how the module is referenced. In the example above though, TypeScript checks if the files exist. Our update logic delegates this check to our virtual file system. The virtual file system currently would throw an error by accident as it walks up the path and discovers that `styles.css` is not a directory, _but_ a file. This results in an error as seen in angular#22919. Fixes angular#22919.
TypeScript resolves modules using a rather complicated module resolution algorithm. The algorithm tries various paths to determine a possible entry-point for a module. e.g. it also respects a containing `package.json` file, or respects the closest `node_modules` parent directory. In some situations, TypeScript could end up trying a path where a parent directory segment resolves to an existent file. e.g. consider the following directory structure: ``` node_modules/my-pkg/package.json node_modules/my-pkg/styles.css ``` TypeScript could end up trying a path like: `node_modules/my-pkg/styles.css/package.json` or `node_modules/my-pkg/styles.css/a/b/package.json`. This depends on how the module resolution executes, and how the module is referenced. In the example above though, TypeScript checks if the files exist. Our update logic delegates this check to our virtual file system. The virtual file system currently would throw an error by accident as it walks up the path and discovers that `styles.css` is not a directory, _but_ a file. This results in an error as seen in angular#22919. Fixes angular#22919.
TypeScript resolves modules using a rather complicated module resolution algorithm. The algorithm tries various paths to determine a possible entry-point for a module. e.g. it also respects a containing `package.json` file, or respects the closest `node_modules` parent directory. In some situations, TypeScript could end up trying a path where a parent directory segment resolves to an existent file. e.g. consider the following directory structure: ``` node_modules/my-pkg/package.json node_modules/my-pkg/styles.css ``` TypeScript could end up trying a path like: `node_modules/my-pkg/styles.css/package.json` or `node_modules/my-pkg/styles.css/a/b/package.json`. This depends on how the module resolution executes, and how the module is referenced. In the example above though, TypeScript checks if the files exist. Our update logic delegates this check to our virtual file system. The virtual file system currently would throw an error by accident as it walks up the path and discovers that `styles.css` is not a directory, _but_ a file. This results in an error as seen in #22919. Fixes #22919. (cherry picked from commit 805d3ae)
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. |
馃悶 Bug report
Command (mark with an
x
)Is this a regression?
I don't knowDescription
After updating Angular 11 -> 12
When running the command
ng update @angular/material
it fails while encountering a reference of a css file in thestyleUrls
-property of a @component annotation.馃敩 Minimal Reproduction
馃敟 Exception or Error
馃實 Your Environment
The text was updated successfully, but these errors were encountered: