Cannot read properties of undefined

David Zinzius 5 Reputation points
2023-04-23T14:49:00.4833333+00:00

Hello, I am trying the Sharepoint Learn lessons from Microsoft for "Extend Microsoft SharePoint – Associate". In the 3rd module: https://learn.microsoft.com/en-gb/training/modules/sharepoint-spfx-web-part-property-pane/?ns-enrollment-type=learningpath&ns-enrollment-id=learn-m365.sharepoint-associate In Unit 5 and 7 I always get the error: Error: Cannot read properties of undefined (reading 'id') TypeError: Cannot read properties of undefined (reading 'id') at https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_de-de_d06a01d566c12f97cf5117ed80a528ce.js:70:731930 at new Promise (<anonymous>) at e.loadComponent (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_de-de_d06a01d566c12f97cf5117ed80a528ce.js:70:731898) at https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_de-de_d06a01d566c12f97cf5117ed80a528ce.js:70:733659 at async Promise.all (index 1) Even if I use the code examples from github. I am using visual studio code and gulp version 2.3 Any ideas what could bethe problem? Thanks David

Microsoft 365 and Office SharePoint Development
{count} vote

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2023-04-24T06:19:28.99+00:00

    Hi @David Zinzius

    Firstly, you should check the version of your environment. You can refer to the list of SPFx development environment compatibility. Then you can try following steps to rebundle the webpart.

    • run gulp bundle and gulp package-solution but don't use the --ship flag so that the generated package will point to your local files
    • deploy the generated package to the app catalog
    • run gulp serve --nobrowser to start the local web server
    • add the web part to the workbench

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. David Zinzius 5 Reputation points
    2023-04-28T06:50:39.2366667+00:00

    Hi

    thank you for your prosposal.

    Environment is like required. I have checked it again.

    Even a deployment to the app store did not help. I have the same error.

    Any other ideas?

    Best regards

    David

    0 comments No comments

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.