Skip to content

Build/serve fails in a pnpm monorepo with solutions using a mix of gulp-based and heft-based SPFx versions #10947

Description

@sbrown-fc

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

Linux

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

My working platform is Windows but I've used a GitHub Codespace to provide a reproduction. The details of that environment:

Node v22.22.1
npm v11.18.0
pnpm v11.12.0
SPFx versions 1.21.1 and 1.23.2

Describe the bug / error

I have a pnpm monorepo with SPFx solutions created over time, using different versions of SPFx. When I try to update one of the solutions to a SPFx version using the heft build I get errors from the webpack part of the process.

I'm unable to make public the repo, so I've created one with the minimum of code as a repro, for details see "Steps to reproduce".

Trying to start the newer solution via

cd packages/new
pnpm run start

gives the following errors:

[build:webpack] Error: Unable to find version "1.23.2" of component "@microsoft/sp-http-msgraph"
[build:webpack] Error: ManifestPlugin: Unable to find entry point for async bundle "new-web-part" in the manifest.

The old solution has a linting error but successfully serves the web part:

cd packages/old
pnpm exec gulp serve

Note that adding @microsoft/sp-http-msgraph as a direct dependency to the new project makes it work, but this shouldn't be needed, as a dependency of a dependency...?!?

Steps to reproduce

Please see this repo: https://github.com/sbrown-fc/spfx-monorepo-fail

Expected behavior

Project should build and serve without errors

Metadata

Metadata

Assignees

Labels

area:spfxCategory: SharePoint Framework (not extensions related)sharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions