Title: Ivy: enableIvy:true ng start rebuild causes custom directive not to be created · Issue #31560 · angular/angular · GitHub
Open Graph Title: Ivy: enableIvy:true ng start rebuild causes custom directive not to be created · Issue #31560 · angular/angular
X Title: Ivy: enableIvy:true ng start rebuild causes custom directive not to be created · Issue #31560 · angular/angular
Description: 🐞 Bug report Command (mark with an x) - [ ] new - [ ] build - [x] serve - [ ] test - [ ] e2e - [ ] generate - [ ] add - [ ] update - [ ] lint - [ ] xi18n - [ ] run - [ ] config - [ ] help - [ ] version - [ ] doc Is this a regression? Unk...
Open Graph Description: 🐞 Bug report Command (mark with an x) - [ ] new - [ ] build - [x] serve - [ ] test - [ ] e2e - [ ] generate - [ ] add - [ ] update - [ ] lint - [ ] xi18n - [ ] run - [ ] config - [ ] help - [ ] ver...
X Description: 🐞 Bug report Command (mark with an x) - [ ] new - [ ] build - [x] serve - [ ] test - [ ] e2e - [ ] generate - [ ] add - [ ] update - [ ] lint - [ ] xi18n - [ ] run - [ ] config - [ ] help - [ ] ver...
Opengraph URL: https://github.com/angular/angular/issues/31560
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ivy: enableIvy:true ng start rebuild causes custom directive not to be created","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄\r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 Bug report\r\n\r\n### Command (mark with an `x`)\r\n\u003c!-- Can you pin-point the command or commands that are effected by this bug? -->\r\n\u003c!-- ✍️edit: -->\r\n```\r\n- [ ] new\r\n- [ ] build\r\n- [x] serve\r\n- [ ] test\r\n- [ ] e2e\r\n- [ ] generate\r\n- [ ] add\r\n- [ ] update\r\n- [ ] lint\r\n- [ ] xi18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n```\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\n\u003c!-- ✍️-->\r\nUnknown\r\n\r\n\r\n### Description\r\n\r\n\u003c!-- ✍️-->\r\nWhen `\"enableIvy\": true` and using `npm start` - custom directives are not created if template file where they are used is changed and the project rebuilt.\r\n\r\n## 🔬 Minimal Reproduction\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\n\r\nIssues that don't have enough info and can't be reproduced will be closed.\r\n\r\nYou can read more about issue submission guidelines here: https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md#-submitting-an-issue\r\n-->\r\n\r\n- Create new app with Ivy enabled and add a directive\r\n```\r\nnpx @angular/cli new test01 --enable-ivy --defaults\r\ncd test01\r\nnpm run ng -- generate directive test-directive\r\n```\r\n- Open the file `test-directive.directive.ts`\r\n- Add `console.log('directive constructor');` in the `TestDirectiveDirective` class constructor code just to monitor directive creation and save the file\r\n- Open `app.component.html` and place the directive attribute `appTestDirective` at the `\u003ch1 appTestDirective>` element (or any other element - does not matter) and save the file\r\n- Serve the app\r\n```\r\nnpm start\r\n```\r\n- Open http://localhost:4200, open developer tools and refresh the browser - you should see \"directive constructor\" logged in the browser console\r\n- Change anything in the `app.component.html` (you can even change the text of the first line which is an HTML comment)\r\n\r\nWhat happens:\r\nThe application rebuilds and reloads but you no longer see \"directive constructor\"\r\n\r\nThe only way to bring directive back is to restart the `npm start`\r\n\r\nThe problem happens with both Node 10.9.0 and Node 12.6.0.\r\n\r\nSimilar problem occurs with pipes but after changing something in the `app.component.html` where the pipe is used, app rebuilt and browser refreshed, there is an error in the browser console:\r\n```\r\nmain.ts:12 Error: The pipe 'testPipe' could not be found!\r\n at getPipeDef$1 (core.js:30810)\r\n at Module.ɵɵpipe (core.js:30776)\r\n at AppComponent_Template (app.component.html:8)\r\n at executeTemplate (core.js:14533)\r\n at checkView (core.js:15957)\r\n at componentRefresh (core.js:15715)\r\n at refreshChildComponents (core.js:14214)\r\n at refreshDescendantViews (core.js:14120)\r\n at ComponentFactory$1.create (core.js:28413)\r\n at ApplicationRef.bootstrap (core.js:35354)\r\n```\r\n\r\nThe problem disappears as soon as you opt out of Ivy usage by changing `tsconfig.app.json` `angularCompilerOptions` to:\r\n```\r\n \"angularCompilerOptions\": {\r\n \"enableIvy\": false\r\n }\r\n```\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\n\u003c!-- If the issue is accompanied by an exception or an error, please share it below: -->\r\n\u003c!-- ✍️-->\r\n\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n\u003cpre>\u003ccode>\r\n\u003c!-- run `ng version` and paste output below -->\r\n\u003c!-- ✍️-->\r\nC:\\dev\\tests\\ng8\\test01>npm run ng -- version\r\n\r\n> test01@0.0.0 ng C:\\dev\\tests\\ng8\\test01\r\n> ng \"version\"\r\n\r\n\r\n _ _ ____ _ ___\r\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\r\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\r\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\r\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\r\n |___/\r\n\r\n\r\nAngular CLI: 8.1.1\r\nNode: 10.9.0\r\nOS: win32 x64\r\nAngular: 8.1.1\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.801.1\r\n@angular-devkit/build-angular 0.801.1\r\n@angular-devkit/build-optimizer 0.801.1\r\n@angular-devkit/build-webpack 0.801.1\r\n@angular-devkit/core 8.1.1\r\n@angular-devkit/schematics 8.1.1\r\n@ngtools/webpack 8.1.1\r\n@schematics/angular 8.1.1\r\n@schematics/update 0.801.1\r\nrxjs 6.4.0\r\ntypescript 3.4.5\r\nwebpack 4.35.2\r\n\r\n\r\n\r\n\r\npackage.json dependencies:\r\n \"dependencies\": {\r\n \"@angular/animations\": \"~8.1.1\",\r\n \"@angular/common\": \"~8.1.1\",\r\n \"@angular/compiler\": \"~8.1.1\",\r\n \"@angular/core\": \"~8.1.1\",\r\n \"@angular/forms\": \"~8.1.1\",\r\n \"@angular/platform-browser\": \"~8.1.1\",\r\n \"@angular/platform-browser-dynamic\": \"~8.1.1\",\r\n \"@angular/router\": \"~8.1.1\",\r\n \"rxjs\": \"~6.4.0\",\r\n \"tslib\": \"^1.9.0\",\r\n \"zone.js\": \"~0.9.1\"\r\n },\r\n \"devDependencies\": {\r\n \"@angular-devkit/build-angular\": \"~0.801.1\",\r\n \"@angular/cli\": \"~8.1.1\",\r\n \"@angular/compiler-cli\": \"~8.1.1\",\r\n \"@angular/language-service\": \"~8.1.1\",\r\n \"@types/node\": \"~8.9.4\",\r\n \"@types/jasmine\": \"~3.3.8\",\r\n \"@types/jasminewd2\": \"~2.0.3\",\r\n \"codelyzer\": \"^5.0.0\",\r\n \"jasmine-core\": \"~3.4.0\",\r\n \"jasmine-spec-reporter\": \"~4.2.1\",\r\n \"karma\": \"~4.1.0\",\r\n \"karma-chrome-launcher\": \"~2.2.0\",\r\n \"karma-coverage-istanbul-reporter\": \"~2.0.1\",\r\n \"karma-jasmine\": \"~2.0.1\",\r\n \"karma-jasmine-html-reporter\": \"^1.4.0\",\r\n \"protractor\": \"~5.4.0\",\r\n \"ts-node\": \"~7.0.0\",\r\n \"tslint\": \"~5.15.0\",\r\n \"typescript\": \"~3.4.3\"\r\n }\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\u003c!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->\r\n\r\n\u003c!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->\r\n","author":{"url":"https://github.com/varadero","@type":"Person","name":"varadero"},"datePublished":"2019-07-13T15:25:28Z","url":"https://github.com/angular/angular/issues/31560"}
| 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:2bccbbb2-4cb4-3b20-bcf4-f62992d7de7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E816:26ECEB:1AF3313:225436C:6B013C08 |
| html-safe-nonce | 20b178b635b2def5a3ad1c440158b8cad80b81e926b64f6d41e71f04cda96661 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODE2OjI2RUNFQjoxQUYzMzEzOjIyNTQzNkM6NkIwMTNDMDgiLCJ2aXNpdG9yX2lkIjoiMzYxNDE5NzAzMjcxMDkxMzAzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 28e75990e365016d928955ec5ae0c201f122661640260e5d6da68404c58b53f0 |
| hovercard-subject-tag | issue:467982359 |
| 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/31560/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0cdcb08c9e613e6b6b439eb95efc17c898dc74548809bfd31ad28c21bdddfdf3/angular/angular/issues/31560 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0cdcb08c9e613e6b6b439eb95efc17c898dc74548809bfd31ad28c21bdddfdf3/angular/angular/issues/31560 |
| og:image:alt | 🐞 Bug report Command (mark with an x) - [ ] new - [ ] build - [x] serve - [ ] test - [ ] e2e - [ ] generate - [ ] add - [ ] update - [ ] lint - [ ] xi18n - [ ] run - [ ] config - [ ] help - [ ] ver... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | varadero |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width