Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Error: Cannot read properties of null (reading 'toString') (see more in sp-rest-proxy console) #149

Closed
kadut001 opened this issue Aug 4, 2022 · 4 comments

Comments

@kadut001
Copy link

kadut001 commented Aug 4, 2022

Response Error
{
"readyState": 4,
"responseText": "Proxy Error: Cannot read properties of null (reading 'toString') (see more in sp-rest-proxy console)",
"status": 400,
"statusText": "Bad Request"
}

porxy-iisue

Console Log Message

GET: https://redacted.sharepoint.us/_api/web/siteusers?
Error TypeError: Cannot read properties of null (reading 'toString')
at OnDemand.saveAuthData (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\node-sp-auth\lib\src\auth\resolvers\OnDemand\OnDemand.js:83:44)
at OnDemand.getAuth (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\node-sp-auth\lib\src\auth\resolvers\OnDemand\OnDemand.js:38:28)
at Object.getAuth (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\node-sp-auth\lib\src\index.js:16:76)
at SPClient. (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\sp-rest-proxy\dist\utils\client.js:69:51)
at step (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\sp-rest-proxy\dist\utils\client.js:44:23)
at Object.next (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\sp-rest-proxy\dist\utils\client.js:25:53)
at C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\sp-rest-proxy\dist\utils\client.js:19:71
at new Promise ()
at __awaiter (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\sp-rest-proxy\dist\utils\client.js:15:12)
at SPClient.fetch (C:\Users\kofi.adutwum\Documents\Page\sandbox\node_modules\sp-rest-proxy\dist\utils\client.js:65:20)

I'm trying to use on demand electron credentials for this proxy.
Any solution to this issue?

Thank you!

@koltyakov
Copy link
Owner

Hi @kadut001,

It's definitely auth thing. On-Demand might be picky to Electron version.

Could you try separating concerns by checking auth via https://github.com/koltyakov/node-sp-auth-troubleshoot raw minimal console approach?

If doesn't work please post to auth library repo https://github.com/s-KaiNet/node-sp-auth

@kadut001
Copy link
Author

kadut001 commented Aug 8, 2022

Hi @koltyakov,

Thank you. It resolved my problem!

@kadut001 kadut001 closed this as completed Aug 8, 2022
@smailsw
Copy link

smailsw commented Sep 5, 2022

@kadut001 i have the same issue, can you provide me please with your solution ? thank you

@kadut001
Copy link
Author

kadut001 commented Sep 6, 2022

Hi @smailsw

Here are my solution

  1. git clone https://github.com/koltyakov/node-sp-auth-troubleshoot
  2. cd node-sp-auth-troubleshoot
  3. npm install
  4. npm run test -- --env uat

I have to run npm run test -- --env uat every 24 hours because the cookies expire but you can put the commands in batch script and have the batch on a scheduler.

Please let me know if it does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants