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
TypeError: Cannot read property 'text' of undefined - Error: NGCC failed. #44019
Comments
That is probably the issue #43938 is going to fix (but I'd have to take a more thorough look to confirm). |
Actually, after looking into it a bit more, this turns out to be a different issue:
So, to fix this, we should update the |
I have this issue currently. Is there a workaround in the meantime? |
Apparently this has been a breaking change since patch release v12.2.11. Currently trying to upgrade to v13. How do we find which libraries in our project Angular is now incompatible with? |
Same issue for Angular 13.0.3
|
I have the same issue after trying to upgrade.
|
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
Hi cheers |
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
… module Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules.
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
… module Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules.
#44245 should fix this. It would be great if you could grab the build artifacts from that PR (as described here) and use them with your projects to see if the problem does indeed go away 🙏 |
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
… module Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules.
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
… module Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules.
Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019
… module Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules.
… module Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules.
Hi is this issue fixed . I am also getting this issue while migrating From Angular 6 to 12 . Is there any work around for this?. Can anyone help me to fix this issue ? |
so i need to add this in package.json file ? |
If you want to try the fix (until it is officially released, probably next week), you can use the URLs from the PR build artifacts in our So, in this case it would be: {
"dependencies": {
"@angular/animations": "https://1089210-24195339-gh.circle-artifacts.com/0/angular/animations-pr44245-b2895b225f.tgz",
"@angular/common": "https://1089210-24195339-gh.circle-artifacts.com/0/angular/common-pr44245-b2895b225f.tgz",
// ...
}
} (Note that you need to replace the package name in the URL for each Angular framework package.) BTW, I am not sure if the fix will be backported to v12 (it will land on v13). |
Thanks for the quick response . Actually my client only need the v12 version . |
Hi! I same too! :( Angular: 13.0.2 Package Version@angular-devkit/architect 0.1300.3 |
… module (#44245) Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See #44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules. PR Close #44245
…#44245) Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes #44019 PR Close #44245
… module (#44245) Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See #44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules. PR Close #44245
…angular#44245) Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019 PR Close angular#44245
… module (angular#44245) Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules. PR Close angular#44245
This fix has been merged and will be included in the next v13 release (13.0.3). @PraveenFrancis, typically we wouldn't backport this to v12 (which is an LTS version) based on our release policy, but since it was an easy/clean backport and we are releasing an LTS version to fix some other issues/regressions, I created #44309. So, the fix will eventually land to the v12 branch, but not sure when the next v12 release will be (could be in a month or so). |
Thx for checking and reporting back, @4kparadise 👍 Could you create a new issue, @4kparadise, and share a minimal reproduction? 🙏 |
You're right, forget to update the compiler-cli to 13.0.3 too. My fault, now it works! |
…angular#44245) Previously, ngcc could only handle UMD modules whose wrapper function was implemented as a `ts.ConditionalExpression` (i.e. using a ternary operator). This is the format emitted by popular bundlers, such as Rollup. This commit adds support for a different format, that uses `if/else` statements, which is what is [emitted by Webpack][1]. [1]: https://webpack.js.org/configuration/output/#type-umd Fixes angular#44019 PR Close angular#44245
… module (angular#44245) Previously, the ngcc `UmdReflectionHost` would throw a misleading error when trying to collect dependencies of an invalidly formatted UMD module. This happened because an error would be thrown while trying to construct the error message for the actual error, by calling `getText()` on certain TypeScript AST nodes. See angular#44019 (comment) for a more in-depth explanation. This commit ensures `getText()` can be safely called on TypeScript AST nodes when collecting dependencies of UMD modules. PR Close angular#44245
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?
Yes, the previous version in which this bug was not present was: 12.2.10Description
After upgrading angular from version 12.2.10 to 12.2.11 or 12.2.12, I can't build anymore my project.🔬 Minimal Reproduction
I attached a repo-app, under the project folder, run the follwoing to reproduce the error:
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
Kindly check below a zip of an angular-cli project to reproduce the error: repro-app.zip
The text was updated successfully, but these errors were encountered: