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
Event is not defined #844
Comments
it may be caused by document |
I experienced this as well, it seems adding hostlistener may lead to this error too |
please have a look at the https://github.com/wpcfan/universal-starter.git, I did not add any document/window stuff, just a directive with @HostListener, and it will cause the error |
Thanks for reporting this, looks like a bug to me, will investigate. |
me help |
Got the exact same error and after applying the fix from @Gorniv I get the same error just with FocusEvent and KeyboardEvent. I don't know what could cause this. |
Removing the type fixes this |
I met the same error when run const domino = require('domino');
const fs = require('fs');
const path = require('path');
const Zone = require('zone.js');
const DIST_FOLDER = path.join(process.cwd(), 'dist');
const template = fs.readFileSync(path.join(DIST_FOLDER, 'browser', 'index.html')).toString();
const win = domino.createWindow(template);
const files = fs.readdirSync(`${process.cwd()}/dist/server`);
import fetch from 'node-fetch';
win.fetch = fetch;
global['window'] = win;
global['DOMTokenList'] = win.DOMTokenList;
global['Node'] = win.Node;
global['Text'] = win.Text;
global['HTMLElement'] = win.HTMLElement;
global['navigator'] = win.navigator;
global['Event'] = win.Event;
global['Event']['prototype'] = win.Event.prototype;
Object.defineProperty(win.document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true
};
},
});
global['document'] = win.document;
global['CSS'] = null; So the error disappeared, and I saw another one: Use
Any solution for this case now? |
I am experiencing this bug as well, but I use aspnetcore-engine. |
I created a PR to fix some issues about
|
I am sorry that I can not reproduce for you a repository with that errors. But, to resolve my problem, I isolated the part which had the call with Event by wrapping everything in the condition of |
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. |
Note: for support questions, please use one of these channels: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports. Also, Preboot has moved to https://github.com/angular/preboot - please make preboot-related issues there.
bug
when I upgrade from angular 5.0.0 to 5.0.1 EventManager was broken with
ReferenceError: Event is not defined
upgrade angular from 5.0.0 to 5.0.1
The text was updated successfully, but these errors were encountered: