Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
Angular CLI: 1.5.0
Node: 8.7.0
OS: win32 x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.2
typescript: 2.4.2
webpack: 3.8.1
Repro steps.
- Create new app with
ng new ....
- Follow https://github.com/angular/angular-cli/wiki/stories-universal-rendering.
- Add
@HostListener('window:click') click(event: MouseEvent) { } in the app.component.ts.
- Run
yarn run build:ssr && yarn run serve:ssr.
Repro: https://github.com/kevinphelps/angular-cli-issue-8412-repro
The log given by the failure.
ReferenceError: MouseEvent is not defined
at C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:12684
at Object.wQAS (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:12867)
at l (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:149)
at Object.aR8+ (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:7591)
at l (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:149)
at Object.bNRb (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:7978)
at l (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:149)
at Object.JwoV (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:995)
at l (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:149)
at Object.Zq8w (C:\Users\Kevin\Desktop\server-test\dist\server.js:129629:7299)
Desired functionality.
The use of Event, MouseEvent, KeyboardEvent, HTMLElement, etc. interfaces should not break the server builds.
Mention any other details that might be useful.
Bug Report or Feature Request (mark with an
x)Versions.
Repro steps.
ng new ....@HostListener('window:click') click(event: MouseEvent) { }in theapp.component.ts.yarn run build:ssr && yarn run serve:ssr.Repro: https://github.com/kevinphelps/angular-cli-issue-8412-repro
The log given by the failure.
Desired functionality.
The use of
Event,MouseEvent,KeyboardEvent,HTMLElement, etc. interfaces should not break the server builds.Mention any other details that might be useful.