Auth0 Home Blog Docs

Npm Error: Argument "documentPath" is not a valid ResourcePath

npm

#1

I am trying to use Auth0 in a firebase function. This was working in the past, but it stopped working and I’m having a hard time tracking down what changed. I’m getting this error:

Error getting userProfile from Auth0: Error: Argument “documentPath” is not a valid ResourcePath

I don’t have an argument “documentPath”, so I’m guessing it is part of the auth0 npm package.

I’m using release 2.9.1.

Any ideas?


#2

do you have any code snippets?


#3

I initialize the auth0 object like this

// Initialize the Auth0 client
var AuthenticationClient = require('auth0').AuthenticationClient;
var auth0 = new AuthenticationClient({
    domain:       'familybank.auth0.com',
    clientID:     '5u-KHjbCzIpTTAxf7C1Hw6SfTePDOVh0'
});

Then I use it like this

let accessToken = app.getUser().accessToken

auth0.getProfile(accessToken).then( function (userInfo) {
    return userInfo;
}).then( function(userInfo) {
    // do stuff with userInfo
}

I think the error is happening when I call getProfile. I have confirmed that I can get the access token properly and it is valid based on the logs in my auth0 dashboard.


#4

hmm. weird. this works for me:

Can you build an isolated repro so I can debug?