Apr 18 2017 02:49 AM
Hi everyone,
I'm working with SPFx framework and I'm using the Pnp js library for REST requests. Everything was working fine since last week when REST requests stop working on sharepoint SitePages but not on the workbench.
When I debug, I notice that the endpoint url changed on the sitepages.
For example, i used to have
https://<tenant>/_api/web/lists?$filter=BaseTemplate%20eq%20171
but now I'm getting
https:/<tenant>/SitePages/_api/web/lists?$filter=BaseTemplate%20eq%20171
and it's not working
Does anyone have the same problem and knows how to solve it?
Thank you.
Apr 19 2017 02:41 AM
Apr 19 2017 07:15 AM
Apr 19 2017 08:26 AM
Tried to reply earlier but didn't seem to post...
This was found and fixed earlier this week and is currently available in a beta release
install sp-pnp-js@beta --save
Please give it a try and if it works as expected we can look to cut a release later today since this is a blocker for folks and we don't want that.
As a side note - if you find issues please do use the issues list. That makes it much easier for us to see what problems folks might be having and address them. Thanks!
Apr 19 2017 08:36 AM
Actually, I just pushed 2.0.4 which includes this fix. It was an out of band update but this is a blocker so was needed. Please update to latest and let us know if you still see issues. Our bad on missing that bug in testing.
Apr 20 2017 02:58 AM
Jun 04 2017 11:31 PM
Hi Patrick,
I'm having the same issue although I have tried both 2.0.4 and 2.0.5. Thanks in advance!
Jun 04 2017 11:35 PM
Hi Robin,
Which version did you use?
Jun 05 2017 05:39 AM
Have you followed the guidance for providing the context to the library within SPFx?
Jun 06 2017 05:07 PM
Actually I can't get the context directly as I wasn't using it in the webpart but component. It's working now after defining baseUrl in pnp.setup.