-
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
Modal component causes 'Error: Token must be defined!' for AoT runtime #1444
Comments
interesting, huge thanks for repo! |
I will take a look asap |
I'm getting the same issue with the typeahead directive. Angular 2.4.2, ng2-bootstrap 1.1.16-11, AOT build. |
@valorkin Any update on this? It would appear that ng2-bootstrap is currently unusable with AOT builds for certain directives, including modal and typeahead. |
I tried to reproduce, but works fine for me. Can you do a sample repo |
@valorkin Did you try the sample repo from @irsick ? |
I think it is missing the stuff from the |
rechecked just in case: https://unpkg.com/ng2-bootstrap@1.2.2/utils/ |
found some sortable component issues, but @irsick repo found another issues |
@valorkin Yes, I am using the seed. |
updated ng2-bootstrap to v1.2.3, no AoT compilation issues now, but
|
if using https://github.com/irsick/ng2-bootstrap-bsModals-issue |
and why not to use angular-cli? |
I will try to create/modify what @irsick has later tonight in order to demonstrate what I am seeing. In the meantime: If I only import the modules I need like If I import like I believe I also saw that error on 1.2.2 but it was after the private items error so I ignored it. Like I said though, I will try to get something demonstrable later on. Why am I using the seed? It is what I started my current project with back when Angular2 first went to beta. It is all I know at this point. |
@sublime392 fixed in v1.2.4, please try again ;D |
I've tested my repo with ng2-bootstrap 1.2.5. The issue still persists. |
I don't know if this is totally useless information, or not: For this line
|
@valorkin I tried loading a modal straight in the root app component instead of a feature module. The error changed to
but
|
And you are using forRoot? Can you fork and update sample repo? |
@valorkin Here you go. I tried to keep it to the bare minimum for example. Instructions are in README. https://github.com/sublime392/ng2-bootstrap-bsModals-issue |
Awesome, thank you! We are getting closer. |
@mgechev have you seen such things before? |
@valorkin I figured it out! woot! I think I sent a pull request. |
awesome, I just was installing dependencies :) |
oh, now I feel so stupid >.< |
whyyyy? |
your PR published as v1.2.6 |
I can not handle this gulp stuff |
I am glad I was able to help a little. I am also pretty stoked about making my first PR to such an awesome project. |
@sublime392 my congratulations with first PR :) |
@valorkin I apologize, but I don't understand this part:
|
https://github.com/valorkin/ng2-bootstrap-bsModals-issue can you try |
I tweaked a couple of imports and it worked. Now I see the bs folder is gone though. When using barrel files with ( systemjs? gulp? something?) the index needs to be on end of import. (unlike webpack). I just don't use barrel files anymore so I dont have to worry about it. |
Thanks I will check it asap |
tried again with ng2-bootstrap v1.2.6 |
I still get
I got same setup (I am importing I tried local build of ng2-bootstrap and exporting |
@valorkin -- did you ever resolve this error? I get the same error on a library I'm working on, and this github issue is literally the ONLY google result :) |
@jlee1201 it seems pretty change: |
actually, I finally figured out that it was because I was using symlink for the library I was working on. Related to: microsoft/TypeScript#9552 |
I use shared module to define Modals and share it with different parts of the app
JIT compilation and runtime work fine.
AoT compilation works fine but during runtime I got this error:
The issue disappears when I remove modal component div (bsModal) from template.
I use Angular 2.4.1, ng2-bootstrap 1.1.16-11
Here is a repo with steps to reproduce:
https://github.com/irsick/ng2-bootstrap-bsModals-issue
Probably it's related to #986
The text was updated successfully, but these errors were encountered: