Coder Social home page Coder Social logo

Comments (6)

christopherthielen avatar christopherthielen commented on April 19, 2024 1

I just released ver 3.1.4 which should resolve this.

from angular-hybrid.

mischkl avatar mischkl commented on April 19, 2024

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).

from angular-hybrid.

JiriPelnar avatar JiriPelnar commented on April 19, 2024

@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.
I suspect a bug either in the angular-hybrid package or in the way rollup is resolving the package.
To make it apparent I have created a minimal example derived from the minimal example of angular-hybrid here:
https://github.com/ui-router/angular-hybrid/tree/master/example
and applying the steps to make AOT work from the offical angular guidelines page:
https://angular.io/guide/aot-compiler

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:
https://plnkr.co/edit/tmViEDxH7PFaQkL0qKU7?p=info

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.

from angular-hybrid.

christopherthielen avatar christopherthielen commented on April 19, 2024

@JiriPelnar can you provide instructions on how to reproduce the error message? perhaps put it in a git repo that I can clone, run yarn && ngc && rollup -c rollup-config.js or whatever the instructions should be?

If I can reproduce it in the plunker, please provide step by step instructions

from angular-hybrid.

JiriPelnar avatar JiriPelnar commented on April 19, 2024

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.

from angular-hybrid.

JiriPelnar avatar JiriPelnar commented on April 19, 2024

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.

from angular-hybrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.