Skip to content

No way of upgrading to new build system, new project creation also broken #10457

@vvolodin

Description

@vvolodin

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

macOS

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

SPFX: 1.22
Node: 22.16

Describe the bug / error

I was about to add some custom build commands before release of our project and I came upon the documentation for the new Heft-based build system. I've updated my project to 1.22 as per https://learn.microsoft.com/en-us/sharepoint/dev/spfx/release-1.22 but there's no way to run the new commands or to upgrade the build system of my current project. I believe this guide from your docs needs a few more steps:

For existing projects

When upgrading an existing project to SPFx v1.22:

    Update your package.json dependencies to SPFx v1.22
    Continue using your existing gulp-based build process
    Evaluate the need to migrate to Heft based on the support timeline
    Plan migration during a maintenance window to minimize disruption

Anyway, I've decided to try and create a new project from scratch to see if I can copy the new build system configuration over to my project. However creating a new project now fails:

yo @microsoft/sharepoint
Error @microsoft/sharepoint

Cannot find module 'ajv/dist/core'
Require stack:
- /Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/@microsoft/generator-sharepoint/node_modules/ajv-draft-04/dist/index.js
- /Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/@microsoft/generator-sharepoint/node_modules/@rushstack/node-core-library/lib/JsonSchema.js
- /Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/@microsoft/generator-sharepoint/node_modules/@rushstack/node-core-library/lib/index.js
- /Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/@microsoft/generator-sharepoint/lib/generators/app/index.js
TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('MODULE_NOT_FOUND')
    at process.set [as exitCode] (node:internal/bootstrap/node:122:9)
    at process.exit (node:internal/process/per_thread:189:24)
    at onError (/Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/yo/lib/cli.js:117:11)
    at /Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/yo/lib/cli.js:168:54
    at async init (/Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/yo/lib/cli.js:168:5)
    at async pre (/Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/yo/lib/cli.js:83:3)
    at async /Users/username/.nvm/versions/node/v22.16.0/lib/node_modules/yo/lib/cli.js:193:3

Steps to reproduce

  1. Have existing 1.21 project, update per instructions
  2. No way to run new build system
  3. No way to create a new project

Expected behavior

  1. Instructions how to upgrade.
  2. Instructions how to run the new system.
  3. Project creation should work.

Metadata

Metadata

Assignees

Labels

area:docsCategory: SharePoint developer/development documentation relatedarea: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