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

Angular AOT - GA or Amplitude Targets - Uncaught TypeError: e is not a function #292

Closed
3 of 13 tasks
rjaguilar opened this issue Oct 16, 2018 · 1 comment
Closed
3 of 13 tasks

Comments

@rjaguilar
Copy link

rjaguilar commented Oct 16, 2018

This is a...

  • 🪲 Bug Report
  • 🚀 Feature Request
  • 📜 Documentation Request

Note: for support questions, please use stackoverflow with the redux-beacon tag. This repository's issues are reserved for feature requests and bug reports.

Which version of Redux Beacon are you using?

  • v2.0.3

Which target(s) are you using?

  • [x ] Google Analytics
  • Google Analytics (gtag)
  • React Native Google Analytics
  • Google Tag Manager
  • React Native Google Tag Manager
  • Amplitude
  • Segment
  • Other/Third Party: ...(please specify here)

(If this is a bug report, feel free to delete the 📜 and 🚀
sections. Likewise, if this is a documentation or feature request, feel free to
delete the 🪲 sections)

🪲 What are the steps to reproduce your issue?

  1. Follow the steps to install the Redux Beacon & @ngrx/store Runnable Example (https://github.com/rangle/redux-beacon/tree/master/examples/ngrx-store)
  2. Use the Google Analytics Target as is or try with an Amplitude Target
  3. run the following: npm run example:start:aot

🪲 What did you expect to happen?

Expect the application should work just like the non AOT compiled version(npm run example:start). Currently facing the same issue on my project as the one that comes with this Runnable example project.

🪲 What happened instead?

Application fails to load due to Uncaught TypeError: e is not a function. There are no compilation errors.

the error happens at @ngrx/store compose function

function compose() {
    var functions = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        functions[_i] = arguments[_i];
    }
    return function (arg) {
        if (functions.length === 0) {
            return arg;
        }
        var last = functions[functions.length - 1];
        var rest = functions.slice(0, -1);
        return rest.reduceRight(function (composed, fn) {
          return fn(composed); // not a function!
        }, last(arg));
    };
}

Attempting the fix suggested in the faq (https://rangle.gitbook.io/redux-beacon/faq) doesn't fix the issue but seems related.

Can you help out?

  • 🌟 I am a legend and can get started on a pull request right away given the go-ahead.
  • ⭐ I am a superstar and would like to help out given some guidance.
  • 😞 I won't be able to help out on this one.
@rjaguilar rjaguilar changed the title AOT - GA or Amplitude - Uncaught TypeError: e is not a function Angular AOT - GA or Amplitude Targets - Uncaught TypeError: e is not a function Oct 16, 2018
@rjaguilar
Copy link
Author

closing this issue.
AOT does not allow exporting defaults (ngrx/store#406)
when importing redux beacon's meta reducer to your store, dont use a default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant