onehilltech / ember-cli-google

a collection of Google services as an Ember CLI add-on
Apache License 2.0
12 stars 3 forks source link

Uncaught TypeError: app.inject is not a function #9

Open jzisser9 opened 9 months ago

jzisser9 commented 9 months ago

Hello, I am attempting to use your google analytics plugin in my Ember 5.4.1 application. I've gone through the setup instructions (here)[https://github.com/onehilltech/ember-cli-google/blob/master/packages/ember-cli-google-analytics/README.md], but when I start my app and attempt to visit it in a browser, I get the error listed in the title. The line where the error occurs appears to be addon/initializers/g-analytics.js:8.

Can you advise what the cause of the issue is and what to do to resolve it? Could it be that the plugin is just out of date?

hilljh82 commented 9 months ago

@jzisser9 As you can see we have not updated this add-on to the latest version. Let me do an update and see if I can reproduce the problem, and then put in a solution. I wonder if there is some other services/dependencies not being loaded.

hilljh82 commented 9 months ago

@jzisser9 UPDATE: I was able to reproduce the error on 5.5. I am not seeing the error on 4.x.

hilljh82 commented 9 months ago

@jzisser9 I have updated the add-on (ver 2.0.2) and the documentation. The problem was that implicit injection was deprecated in Ember 4, and removed in Ember 5.

Please see the README for the additional steps needs to use this add-on in your Ember 5 application.