Title: AOT Error resolving funcion symbol statically. Worked in 2.3.1 and not in 2.4.0 · Issue #13605 · angular/angular · GitHub
Open Graph Title: AOT Error resolving funcion symbol statically. Worked in 2.3.1 and not in 2.4.0 · Issue #13605 · angular/angular
X Title: AOT Error resolving funcion symbol statically. Worked in 2.3.1 and not in 2.4.0 · Issue #13605 · angular/angular
Description: I'm submitting a ... (check one with "x") [X] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...
Open Graph Description: I'm submitting a ... (check one with "x") [X] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request...
X Description: I'm submitting a ... (check one with "x") [X] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not su...
Opengraph URL: https://github.com/angular/angular/issues/13605
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AOT Error resolving funcion symbol statically. Worked in 2.3.1 and not in 2.4.0","articleBody":"**I'm submitting a ...** (check one with \"x\")\r\n```\r\n[X] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature 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```\r\n\r\n**Current behavior**\r\nI have my own property decorators (used for validation) applied throughout a sizable Angular project. These decorators have had no issues with `ngc` with the exception of maybe requiring one of the params passed to the decoration to be exported. However, as of `2.4.0` I am getting the following error:\r\n\r\n```\r\nError: Error encountered resolving symbol values statically. Calling function '[function name]',\r\nfunction calls are not supported. Consider replacing the function or lambda with a reference to\r\nan exported function.\r\n```\r\n\r\nTo provide more detail, the decorator allows to be passed a custom validation function as part of one of it's parameters. I attempted to save the passed function value as an exported constant and still received the same error.\r\n\r\nReverting to `2.3.1` \"resolves\" the issue. Of course there are ways to work around this, but I thought I should bring it up in case there's something that was not caught in regression testing or something of the sort.\r\n\r\n**Expected behavior**\r\nAOT compilation with no error. I have been able to compile with these decorators since around `rc.6` days, around the time that I wrote them.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\nSorry, cannot reproduce since it's an AOT compilation issue. If it's helpful, this would be a simplified representation of what I described above:\r\n```ts\r\nexport const validationOptions = { option: optionValue };\r\n@MyValidationDecorator( TypeEnum.type, ValidationFunction(validationOptions) )\r\nmyClassProp: type;\r\n```\r\n\r\nAdditionally, also as mentioned above, the following doesn't work either, attempting to follow the indication of \"Consider replacing the function or lambda with a reference to an exported function.\":\r\n```ts\r\nexport const validation = ValidationFunction({ option: optionValue });\r\n@MyValidationDecorator( TypeEnum.type, ValidationFunction(validation) )\r\nmyClassProp: type;\r\n```\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nIdeally, being able to move forward with the same path I had been for a few months now. Like I said, there's ways to work around this, but ideally I wouldn't have to unless theres a specific Angular Compiler need/benefit to this process. I looked at the change log and there are some compiler changes around metadata, but I did not see something that immediately jumped at me as the cause of this Error.\r\n\r\n**Please tell us about your environment:**\r\nMac OS X 10.11.6, VSCode 1.9.0-insider, npm 3.10.8, webpack 2.2.0-rc.1, webpack-dev-server 2.2.0-rc.0, Typescript 2.0.10\r\n\r\n* **Angular version:** 2.4.0. Not an issue with 2.3.1\r\n\r\n* **Browser:** Not in browser\r\n \r\n* **Language:** Typescript 2.0.10\r\n\r\n* **Node (for AoT issues):** `node --version` = `v6.9.1`\r\n","author":{"url":"https://github.com/emilio-martinez","@type":"Person","name":"emilio-martinez"},"datePublished":"2016-12-21T09:28:17Z","url":"https://github.com/angular/angular/issues/13605"}
| 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:5954efc4-4de6-1dc5-3b29-cdd290a27b9d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE08:2270F4:68BEEA:8D36BB:6B00D703 |
| html-safe-nonce | 3a8156675eabe104bef5b100d467e8d8dbca6ae63592cba67e739323392f94e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTA4OjIyNzBGNDo2OEJFRUE6OEQzNkJCOjZCMDBENzAzIiwidmlzaXRvcl9pZCI6IjIyMDY5MDQ1MjY2MzAzNDQ0NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f768c044068111b14eff05fff4e2a91cd8207250562785e69c1fe986cb371c40 |
| hovercard-subject-tag | issue:196884365 |
| 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/13605/issue_layout |
| twitter:image | https://opengraph.githubassets.com/834b6262b6c481b16fcc80e3bdadeb354b1892926d4b4bf7326034b316c4a9cf/angular/angular/issues/13605 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/834b6262b6c481b16fcc80e3bdadeb354b1892926d4b4bf7326034b316c4a9cf/angular/angular/issues/13605 |
| og:image:alt | I'm submitting a ... (check one with "x") [X] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emilio-martinez |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width