Webpart with property pane controls don't work after completing all steps in exercise

Andersson, Frida 20 Reputation points
2025-02-03T09:58:18.1533333+00:00

I have now followed and completed all the steps in the exercise "Exercise - Use the SPFx PnP reusable property pane controls", but I get an error when adding the web part. The image below shows the error message and what I see in the F12 console.

Screenshot_1

Here is the link to the exercise: https://learn.microsoft.com/en-us/training/modules/sharepoint-spfx-web-part-property-pane/7-exercise-pnp-controls

I have added the web part both using the Workbench and by creating my own page and using the debug link on it. I get the same error in both cases.
I am using the same versions specified in the exercise and have even checked the source code on GitHub to ensure that it matches exactly (HelloPnPControlsWebPart.ts & package.json).

I have also performed the following steps and still get the same error:

  1. Deleted "node_modules" and "package-lock.json"
  2. Ran npm install
  3. Ran gulp clean
  4. Ran gulp build
  5. Ran gulp serve

How can I proceed to get this working?

Microsoft 365 Training
Microsoft 365 Training
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.Training: Instruction to develop new skills.
115 questions
{count} votes

Accepted answer
  1. kguntaka 4,830 Reputation points Microsoft Vendor
    2025-02-06T09:47:02.44+00:00

    Hi Andersson, Frida,

    I'm happy that you were able to fix the issue and that it was self-resolved on your end. We will consider your suggestions and let our backend team know if any changes are required for the exercise. As part of its ongoing efforts to enhance end-user products, Microsoft encourages feedback, which will be considered throughout the exercise. We request you to finish your learning goals and keep MS Learning. 

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Ask: Webpart with property pane controls don't work after completing all steps in exercise

    Solution: User's imageIf I missed anything please let me know and I'd be happy to add it to my answer, or feel free

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.