Coder Social home page Coder Social logo

AoT compatibility about angular-page-visibility HOT 3 CLOSED

dnmd avatar dnmd commented on July 24, 2024
AoT compatibility

from angular-page-visibility.

Comments (3)

dnmd avatar dnmd commented on July 24, 2024 2

Hi,

Thanks for the quick response. In the meanwhile I was able to fix it, I have added the solution below and it may be usefull to add to the readme (but feel free not to).

Original issue: using this lib in an Ionic 2 project and creating a production build npm run ionic:build --prod the following error was thrown:

[15:53:18]  ngc started ...
[15:53:32]  typescript error
            Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing
            the function or lambda with a reference to an exported function (position 194:50 in the original .ts file),
            resolving symbol NgModule in

Solution:
To use this library in an Ionic 2 project update the "compileOptions" in tsconfig.json in the root of the project with a "baseUrl" and "paths" property like so:

  "compilerOptions": {
    ...
    "baseUrl": "src",
    "paths": {
      "@angular/*": [
        "../node_modules/@angular/*"
      ]
    }
  },

With that you can compile an Ionic 2 production build as well! Thanks and keep up the good work!

from angular-page-visibility.

olivierlsc avatar olivierlsc commented on July 24, 2024 2

Hi @dnmd ,

Thank you for your solution and your encouragement!

from angular-page-visibility.

olivierlsc avatar olivierlsc commented on July 24, 2024

Hello, Thank you for using this lib :-). I am very happy that it serves you. If you use angular-cli AOT is supported. Can you test with 'ng build --prod'?

from angular-page-visibility.

Related Issues (15)

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.