Skip to content

SPFx webpart can't be loaded: Cannot read properties of undefined (reading 'id') #10649

@miguelisidoro

Description

@miguelisidoro

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version: Edge 144.0.3719.115
  • SPFx version: 1.22.2
  • Node.js version: 22.22.0

Describe the bug / error

I am migrating a SPFx solution from 1.9.1 to SPFx 1.22.2. All steps of the migration process were completely sucessfully and all SCSS, TypeScript an eslint errors were solved and the solution is building sucessfully.

However, I am getting this error after deploying the web part to the Site Collection App Catalog:

Could not load my-web-part in require. TypeError: Cannot read properties of undefined (reading 'id')
at sp-pages-assembly_en-us_90032a83f8eaa3f8b6d063951bd8f3bb.js:227:12727
at new Promise ()
at e.loadComponent (sp-pages-assembly_en-us_90032a83f8eaa3f8b6d063951bd8f3bb.js:227:12695)
at sp-pages-assembly_en-us_90032a83f8eaa3f8b6d063951bd8f3bb.js:227:6401
at async Promise.all (/sites/QAS/SitePages/index 0)

I have been searching the web and talking to Copilot but after almost one day of researching and troubleshooting, I was unable to successfully make SharePoint to load the web part.

Can anyone help me to solve this error?

Thanks

Steps to reproduce

  1. heft clean && heft test --production && heft package-solution --production
  2. Upload the new version to the Site Collection App Catalog
  3. Test the page where the web part is included

Expected behavior

The web part to work properly.

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.area:spfxCategory: SharePoint Framework (not extensions related)sharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions