-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ReferenceError: MouseEvent is not defined (Angular 2 Universal) #964
Comments
Just add import { DropdownModule } from 'ng2-bootstrap/ng2-bootstrap'; // <- this line
@NgModule({
imports: [
DropdownModule // <- and this line
]
}) in main.node.ts, you will see the error. |
@valorkin you deleted the events in this PR: https://github.com/valor-software/ng2-bootstrap/pull/919/files |
It was more like a type hack for universal, maybe some typings could help or need to revert this hack back |
Any workaround in the meanwhile? |
Only workaround I have found was to either use regexp-replace in webpack and search for [MouseEvent] and replace to [] and doing the same for KeyboardEvent etc. Do this only for the serverConfig in webpack. |
thx for the tipp, I tried to remove it manually and it works. Just struggeling with the string-replace loader. I added the following code to my webpack config
But it doesn't work. Can you please provide your config? is there a possiblity to just scan the node_modules folders? |
Seems we have finished with AoT support, so I can revert a hack for universal |
work for me
|
Is it working and we can close this issue? |
@Junik It's been a long time, but maybe someone is still watching: where do you add the regex test? I'm using angular-cli v5 |
@flashcrow2000 It is added into the webpack conf file. But this shouldn't be a problem anymore. |
@u12206050 it is with another module.. google maps |
@flashcrow2000 hope you are right, I hate |
This is still an issue. This is a recurring issue with events. |
@stephengardner yep, this is why we are adding test of cypress + universal |
The old error is back when using latest universal-starter and ng2-bootstrap.
The text was updated successfully, but these errors were encountered: