title: SPFx using @pnp/sp to create list
body: <p>I'm trying to create a custom list using <strong>@pnp/sp</strong>, in my routine I need to check if the list does exist, if it doesn't, them I will create the list and add the its columns.</p>
  
  <p>The code below sometimes work, guess it is because <strong>sp.web.*</strong> methods are async, and it causes problems.</p>
  
  <p>So, what is the correct way to 1) check for a particular list, 2) add the list if it doesn't exist, 3) add the fields to the list?</p>
  
  <pre><code>sp.web.lists.ensure("SliceBox").then( List =&gt; {    
      List.fields.getByTitle("Body").get().catch( f =&gt; {
          f.fields.addMultilineText("Body", 4, true, false, false, true);
      });
  
      List.fields.getByTitle("Link").get().catch( f =&gt; {
          f.fields.addUrl("Link", UrlFieldFormatType.Hyperlink);
      });
  
      List.fields.getByTitle("Visible").get().catch( f =&gt; {
          f.fields.addBoolean("Visible");
      });
  })
  .catch( err =&gt; {
      console.log("&gt; Failure: ", err);
  });
  </code></pre>
  
  <p>Doesn't matter if I try the very explicit way (see below) it will also fail:</p>
  
  <pre><code>sp.web.lists.ensure("SliceBox").then( List =&gt; {
      sp.web.lists.getByTitle("SliceBox").fields.getByTitle("Body").get().catch( f =&gt; {
          f.fields.addMultilineText("Body", 4, true, false, false, true);
      });        
      // ... shortened for brevity ...
  })
  .catch( err =&gt; {
      console.log("&gt; Failure: ", err);
  });
  </code></pre>