Reputation: 523
I am using the dispatch:phoneformat.js
package. It works fine on the client side, but when I attempt to use it server side I get the following error: [Error: Object #<Object> has no method 'formatE164']
Looking at the GitHub repo, I believe it should work server-side "out-of-the-box"
I'm simply trying to call Phoneformat.formatE164
from a Meteor method. It works fine if I call it from client side code.
Upvotes: 1
Views: 111
Reputation: 75975
According to the source code on the package from https://github.com/DispatchMe/phoneformat.js/
The package does not support getting formatE164
on the server side. The only server side methods are Phoneformat.configure
which allows you to use the phoneformat.getCountryForIp
method.
It looks a bit like the package was designed to be this way. You may have to request the author to modify it to be more isomorphic.
I suspect the google.phoneformat.js
package its built from doesn't run on the server judging from the use of client side window
code in the file. This may be why the method only works on the client side.
Upvotes: 1