Just wondering if I could get some help. I built a small webpart that sends an email. On my local workbench it works fine however when I deploy to production

Error: Error making HttpClient request in queryable [404] Not Found ::>

My Import

import { sp,  EmailProperties } from "@pnp/sp";

My OnInit establishes context

 public onInit(): Promise<void> {
    return super.onInit().then(_ => {
      // establish SPFx context
        spfxContext: this.context


Send email

  const emailProps: EmailProperties = {
          To: ["[email protected]"],
          Subject: "This email is about...",
          Body: "Here is the body. <b>It supports html</b>"

        sp.utility.sendEmail(emailProps).then(_ => {
          console.log("Email Sent!");

1 Answer 1


Sorry, stupidity on my part.

Correct code is:

    spfxContext: this.props.context
  • Hi Lori, I have the same issue. But when I add this.props.context. It comes up with an error Property props does not exist on type "MyWebPart". Can you share you code Jul 8, 2019 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.