Closed hasankoroglu closed 4 years ago
You're calling loadPageContext();
without waiting when it is resolved.
Should be thenable logic or awaiting.
After, it's a good thing to check what's in _spPageContextInfo.webAbsoluteUrl
property.
I think, i could not explain my problem clearly :( when i call the loadPageContext function, it is sending the request to the localhost:3000 (CRA dev server), but sp-rest-proxy runs on localhost:8080.
Do you have "proxy": "http://localhost:8080",
in package.json? Details. CRA proxies to the proxy, sp-rest-proxy adds auth and proxies to SharePoint. And too many proxy
words in that sentence. :D
Thankx, thanx and thanx again. It's all about my missing information and missing learning :(
Hi @koltyakov,
As you suggested, i'm trying to use loadPageContext. My app runs on localhost:3000 and sp-rest-proxy runs on 8080 port. when i run my app, loadPageContext function tries to get data from localhost:3000/api/web... And it gives 404 error. What am i doing wrong? My public code is here: https://github.com/hasankoroglu/sp-pnp-js Sorry for bothering you with this simple issue :(