Jump to content
McKay Development

Getting image.match is not a function on uploadAvatar()


Recommended Posts

Posted (edited)

Hello when attempting to upload an avatar using uploadAvatar() I'm getting an error of image.match is not a function

Here is my code
 

var av = "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"

function uploadAvatar() {
    community.uploadAvatar(av, function (err) {
        if (err) {
            console.log(err)
        } else {
            console.log(url)
        }
    }
    )
}

Here is the full error 
 

C:\Users\X\Documents\dev\X\node_modules\steamcommunity\components\profile.js:273
        } else if(image.match(/^https?:\/\//)) {
                        ^

TypeError: image.match is not a function
    at SteamCommunity.uploadAvatar (C:\Users\X\Documents\dev\X\node_modules\steamcommunity\components\profile.js:273:18)

Thank you for any help

Edited by EmDoesCs
  • EmDoesCs changed the title to Getting image.match is not a function on uploadAvatar()
Posted
9 hours ago, Dr. McKay said:

You're probably overwriting av somewhere, it seems like it's not a string.

Hmm. I tried doing the string directly in the function, I also tried importing my own image locally. All of which resorted in that error. 

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...