Skip to content
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

References errors Element, MouseEvent... not defined #529

Closed
antonbarada opened this issue Sep 14, 2016 · 9 comments
Closed

References errors Element, MouseEvent... not defined #529

antonbarada opened this issue Sep 14, 2016 · 9 comments

Comments

@antonbarada
Copy link

it occurs when using third-party plugins (etc ng2-bootstrap, angular2-masonry, clipboard).
There are errors such "Element, MouseEvent... not defined" when application run on server

@antonbarada antonbarada changed the title References errors when using third-party plugins References errors Element, MouseEvent... not defined Sep 14, 2016
@PatrickJS
Copy link
Member

this is because those are browser only types that

@hongbo-miao
Copy link

hongbo-miao commented Sep 14, 2016

@thebarada for ng2-bootstrap, please track this issue valor-software/ngx-bootstrap#964, it should be solved soon

@antonbarada
Copy link
Author

@gdi2290 @hongbo-miao
ok, thnx!

@hongbo-miao
Copy link

hongbo-miao commented Sep 19, 2016

@thebarada no problem, you can create an issue on angular2-masonry if you meet the problem

@crebuh
Copy link

crebuh commented Sep 28, 2016

@thebarada

I experienced the same issue, but then I was wondering why to import the Ng2BootstrapModule on the server side?

@scott-wyatt
Copy link

@crebuh because it wouldn't really be isomorphic if you couldn't... However, the dirty work around is in the docs. You can load any module and have browser side pick one side and node pick the other, however that leaves you with having to shim up module by module which also really defeats the point. There is some promise in the new createGlobalProxy but it still pretty far off from shimming all browser functions.

@antonbarada
Copy link
Author

@crebuh do you mean that I should not import bootstrap on server?
but how I will use bootstrap components on server side?
in this case, when rendering will be errors about unknown components

@MarkPieszak
Copy link
Member

Use ng2bootstrap @thebarada, it doesn't use jQuery or anything and should work.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants