Title: Function calls are not supported in decorators when fullTemplateTypeCheck is not specified and @dynamic has no effect · Issue #23609 · angular/angular · GitHub
Open Graph Title: Function calls are not supported in decorators when fullTemplateTypeCheck is not specified and @dynamic has no effect · Issue #23609 · angular/angular
X Title: Function calls are not supported in decorators when fullTemplateTypeCheck is not specified and @dynamic has no effect · Issue #23609 · angular/angular
Description: I'm submitting a... [X] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submi...
Open Graph Description: I'm submitting a... [X] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ...
X Description: I'm submitting a... [X] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or reques...
Opengraph URL: https://github.com/angular/angular/issues/23609
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Function calls are not supported in decorators when fullTemplateTypeCheck is not specified and @dynamic has no effect","articleBody":"\u003c!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[X] Regression (a behavior that used to work and stopped working in a new release)\r\n[ ] Bug report \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n[ ] Other... Please describe:\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\nWhen building a library and specifying both `skipTemplateCodegen` and `strictMetadataEmit` to `true`, and you try to call a method inside the `ngModule` decorate example `RouterModule.forChild([])` this will cause a compilation error `Function calls are not supported in decorators but 'RouterModule' was called.`\r\n\r\nWhen adding `fullTemplateTypeCheck` to `true` the error is not emitted.\r\n\r\nAlso, `@dynamic` seems not to have any effect in this particular case.\r\n\r\n## Expected behavior\r\nNo error emitted, or at least that it can be suppressed with the `@dynamic`. \r\n\r\nI also expect that setting `fullTemplateTypeCheck` doesn't have any effect here as this flag relates more to binding in templates.\r\n\r\n## Minimal reproduction of the problem with instructions\r\nCreate a file example\r\n```ts\r\nimport { NgModule } from '@angular/core';\r\nimport { RouterModule } from '@angular/router';\r\n\r\n@NgModule({\r\n imports: [\r\n RouterModule.forChild([])\r\n ]\r\n})\r\nexport class LibModule { }\r\n```\r\n\r\nHave tsconfig set with the following options;\r\n```\r\n \"angularCompilerOptions\": {\r\n \"skipTemplateCodegen\": true,\r\n \"strictMetadataEmit\": true\r\n }\r\n```\r\n\r\nWhen transpiling this will emit an error;\r\n```\r\nError during template compile of 'LibModule' Function calls are not supported in decorators but 'RouterModule' was called.\r\n```\r\n\r\nNote when adding `\"fullTemplateTypeCheck\": true` no error is emitted. (Though this is kinda weird as I don't think this shouldn't have any effect)\r\n\r\nReproduction repo: https://github.com/alan-agius4/angular-issue-23609\r\n\r\n\r\n## What is the motivation / use case for changing the behavior?\r\nNo error was emitted in NG 5\r\n\r\n## Environment\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 6.0.0-rc-6\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n\u003c/code>\u003c/pre>\r\n\r\nRelated issues:\r\nhttps://github.com/dherges/ng-packagr/issues/822\r\nhttps://github.com/dherges/ng-packagr/issues/778\r\nhttps://github.com/dherges/ng-packagr/issues/727\r\nhttps://github.com/dherges/ng-packagr/issues/765\r\nhttps://github.com/dherges/ng-packagr/issues/767\r\nhttps://github.com/dherges/ng-packagr/issues/885\r\n","author":{"url":"https://github.com/alan-agius4","@type":"Person","name":"alan-agius4"},"datePublished":"2018-04-30T14:25:05Z","url":"https://github.com/angular/angular/issues/23609"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3a2d5f91-97b1-5e2e-9120-71c2565e3415 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD7A:2E124E:B8C5A9:ECDF36:6B00FD49 |
| html-safe-nonce | 89abae13a0af934b98ec46a4d2b46b4e29b841fde6b0a4c5be397d4f748cf743 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDdBOjJFMTI0RTpCOEM1QTk6RUNERjM2OjZCMDBGRDQ5IiwidmlzaXRvcl9pZCI6Ijc3NjYzNTkzOTc3MTgwOTcyMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dd01ce2b6d242777ca47fbb7282d67874ede50cc5584cfaddb43963df10091f0 |
| hovercard-subject-tag | issue:318908851 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/23609/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e08a796a8c10b4b0ff0fa5e946b6593fa124dea0073bd454983da2344ecca6c2/angular/angular/issues/23609 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e08a796a8c10b4b0ff0fa5e946b6593fa124dea0073bd454983da2344ecca6c2/angular/angular/issues/23609 |
| og:image:alt | I'm submitting a... [X] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alan-agius4 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width