Forum Discussion

Mike Jansen's avatar
Mike Jansen
Iron Contributor
Oct 25, 2017
Solved

SPFX - Pnp.sp.search. Simple HelloWorld will not build

I created te default HelloWorld app with React. Added pnp (npm install sp-pnp-js -- save)   So far so good. Gulp serve and the app runs fine.   Now I want to add a search so I changed the HelloW...
  • Mike Jansen's avatar
    Oct 26, 2017

    Used a different syntax which is working:

     

    private GetSearchresults(): void {
        pnp.sp.search({
          Querytext: "ContentType:TEST_matters",
          RowLimit: 5
        }).then((result: SearchResults) => {
          var props = result.PrimarySearchResults;
    });

    Still do not understand why the first one does not build because is does in a non-react example.