benmarch / angular-ui-tour

Product tour using Angular UI Bootstrap Tooltips
163 stars 49 forks source link

TypeError: e is not a constructor #140

Closed Catrionaa closed 7 years ago

Catrionaa commented 7 years ago

Browser: Chome Version: 59.0.3071.115 AngularJS: 1.6.5 Angular Bootstrap: 2.0.1 Angular UI Tour: 0.8.1

I have installed this library via: NPM

I have observed the following behavior: Hi I am fairly new to angualr.js so sorry if this is just a silly mistake! Is there any reason why when trying to load in a basic example I get the error: TypeError: e is not a constructor.

benmarch commented 7 years ago

Hi @Catrionaa, this looks like a minification issue. Be sure to use Array Notation (or something that compiles to it) when creating Angular services. Let me know if that is the issue.

erikdonohoo commented 7 years ago

@benmarch It is happening directly in your code. Your suggestion of Array Notation is needed for some place in your own code before minifying. I also can't load this from just a simple example after including your file and its dependencies.

image

benmarch commented 7 years ago

Hey @erikdonohoo, I'm looking through my codebase but I don't see anywhere that I'm not using ng-annotate or array notation. Thank you for the screenshot; could you take another one of that line at the top of the stack trace (angular-ui-tour.js:formatted:1416)? I'll keep looking into it on my end.

benmarch commented 7 years ago

@erikdonohoo are you loading all the dependencies before Angular UI Tour? There might be a bug in Hone that requires it to be loaded before AUIT. Please let me know.

erikdonohoo commented 7 years ago

I was loading all the dependencies first before angular-ui-tour. But I should double check.

Spuffynism commented 7 years ago

I had the same error when Hone wasn't loaded.

To fix the error, I installed Hone with npm and made sure dist/hone.js was included before AUIT.

benmarch commented 7 years ago

This should be fixed in 0.9.0

mahendra2125 commented 7 years ago

Hi, I am using requirejs to load the modules in my angularjs app. while loading this i am getting the below error would you please help with this.

error

rajassbj commented 7 years ago

I am also getting similar error as mentioned above..... e is not a constructor

mahendra2125 commented 7 years ago

Do you have any update about the issue updated above.

benmarch commented 7 years ago

Hi @mahendra2125, I'm sorry for the delay, I didn't see these comments...

I thought I was able to fix it as of 0.9.0, but I will take another look. For now there is a workaround by loading the Hone dependency prior to loading Angular UI Tour.

I'll reopen this issue, and look at it today.

mahendra2125 commented 7 years ago

Hi,

Please modify this typo "hone" to "Hone" in the line define("uiTour", ["angular", "angular-sanitize", "angular-scroll", "ez-ng", "angular-hotkeys", "angular-bind-html-compile", "tether", "hone"], factory);

which will fix the above error.

benmarch commented 7 years ago

Hey @mahendra2125, since that is generated code it is a little more complicated than that. However, I think I found a good solution and will release it soon.

tverburg commented 7 years ago

Unfortunately I pulled AUT 0.9.2 yesterday and still have this issue.