ctjp / autoform-intl-tel-input

Custom input type "intl-tel-input" for AutoForm
MIT License
3 stars 2 forks source link

Exception from Tracker afterFlush function: undefined is not a function #1

Closed rfines closed 9 years ago

rfines commented 9 years ago

I recently upgraded Meteor to 1.1 and am receiving this error when I try to use this package. Here is how I have it set up in my schema:

contact:{
    type:Object,
    optional:true,
    label:"Contact Information"
},
"contact.name":{
    type:String,
    label:"Contact Name"
},
"contact.phone":{

    type: String,
    label:"Contact Phone",
    autoform: {
        type: 'intl-tel-input',
        'class': 'form-control',
        afFieldInput: {
            inputOptions: {
                autoFormat: true,
                defaultCountry: 'auto'
            }
        }
    }

},
"contact.email":{
    type:String,
    regEx: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
    label:"Contact Email"
},

and here is the autoform usage:

{{> afQuickField name="contact"}}

and the rendered control:

<input type="tel" class="form-control" name="contact.phone" required="" data-schema-key="contact.phone">

I am getting Exception from Tracker afterFlush function: undefined is not a function

TypeError: undefined is not a function at Template.afIntlTelInput.rendered (http://localhost:3000/packages/ctjp_autoform-intl-tel-input.js?b397524d8dc3498d14b10afb103c039d951cb1f9:88:10) at null. (http://localhost:3000/packages/blaze.js?77c0809654ee3a10dcd5a4f961fb1437e7957d33:2970:21) at http://localhost:3000/packages/blaze.js?77c0809654ee3a10dcd5a4f961fb1437e7957d33:1720:14 at Object.Blaze._withCurrentView (http://localhost:3000/packages/blaze.js?77c0809654ee3a10dcd5a4f961fb1437e7957d33:2029:12) at http://localhost:3000/packages/blaze.js?77c0809654ee3a10dcd5a4f961fb1437e7957d33:1719:15 at Tracker.flush (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:438:11)

Do you have any suggestions?

Thanks

rfines commented 9 years ago

There is no problem with this package. It was completely a mistake on my part, I had not installed the other intl-tel package as the documentation clearly say you need to. I guess I did not recognize that there were two separate packages involved. After the installation of the meteor-intl-tel-input package it works like a charm and is a really nice addon for autoform.