-
Notifications
You must be signed in to change notification settings - Fork 75
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
Is angular-hybrid compatible with AOT? #47
Comments
Yes, AOT compatibility should work, if you follow all the steps listed in the README, or better yet copy the code from the example (it's more complete and up-to-date). |
@mischkl thank you for your comment, I went through the README another time to check if I have left something important out. I believe I have all important parts covered, after all, the JIT version is working well. This way I needed to adjust the package.json, tsconfig.json and main.ts files, and I needed to introduce app,module.ts and rollup-config.js files, all of which can be found adjusted inside this plunker: The result of running rollup on the AOT compiled code is this error mesaage: uirouter/angular-hybrid is imported by src\app.module.js, but could not be resolved - treating it as an external dependency I would really appreciate any help here as this is a stopper for our application if we should rely on using ui-router. |
@JiriPelnar can you provide instructions on how to reproduce the error message? perhaps put it in a git repo that I can clone, run If I can reproduce it in the plunker, please provide step by step instructions |
Thank you @christopherthielen for looking into this issue. The problem may be on my part, as I might still be missing something, but I am unable to figure out what that could be. However, I put together this repository with the necessary steps to reproduce the rollup error explained in detail in its readme. Also, please note this answer from @Radim-Kohler to my question related to the same issue on stack overflow. Adjusting the rollup-config the way proposed in the answer makes the rollup step work just fine and it makes me think that maybe the structure of angular-hybrid package can be changed to work with rollup without this special configuration in rollup-config. |
I just released ver 3.1.4 which should resolve this. |
Thank and thank you very much for doing this amazing library. I have tested the version 3.1.4 and it indeed works for the angular-hybrid case. I believe a similar fix is also needed for uirouter/core, for which I still need to keep the custom resolver in rollup config in place. |
In our angularjs / angular hybrid application we use ui-router and it works great when using JIT. Now I am trying to make it work with AOT and all my effort seem to fail. First I tried using rollup and rollup for some reason fails to resolve angular-hybrid package. I then tried to make the application work using webpack, and while the bundling completed successfully, the states that I define inside angular 2 modules do not seem to be registered in the stateRegistry. Am I doing something completely wrong? Should this be working? If it should be working, I will try to reproduce it using a plunker.
The text was updated successfully, but these errors were encountered: