microsoftgraph / microsoft-graph-toolkit

Authentication Providers and UI components for Microsoft Graph 🦒
https://docs.microsoft.com/graph/toolkit/overview
Other
949 stars 305 forks source link

[BUG] Manifest not found error, mgt-spfx #1735

Closed tabit01 closed 2 years ago

tabit01 commented 2 years ago

Describe the bug Error in Sharepoint hosted workbench, as well as Sharepoint site:

Something went wrong
If the problem persists, contact the site administrator and give them the information in Technical Details.
TECHNICAL DETAILS
[SPLoaderError.loadComponentError]:
Failed to load component "4f45c562-805c-42da-81cc-8e84bf7834b0" (TreeOrgChartWebPart). Original error: Manifest not found for component id "78b11c7d-7ca8-47cb-a93c-d3beabb519a1" and version "2.5.2".

INNERERROR:
Manifest not found for component id "78b11c7d-7ca8-47cb-a93c-d3beabb519a1" and version "2.5.2".
CALLSTACK:
Error
    at t [as constructor] (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_d773573f7d35b6f7a679f16c44d839ae.js:70:214899)
    at new t (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_d773573f7d35b6f7a679f16c44d839ae.js:72:7680)
    at e.buildErrorWithVerboseLog (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_d773573f7d35b6f7a679f16c44d839ae.js:72:44944)
    at e.buildLoadComponentError (https://res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_d773573f7d35b6f7a679f16c44d839ae.js:72:41035)
    at https://res-1.cdn.office.net/files/sp-client/chunk.systemjs-component-loader_en-us_dc58eaaa7aaff14eda18.js:1:6012

To Reproduce Steps to reproduce the behavior:

  1. Run gulp serve on webpart, setting hosted workbench in serve.json to initial page.
  2. Run gulp bundle --ship and gulp package-solution --ship
  3. Upload .sppkg file to Sharepoint app catalog.
  4. Insert webpart on Sharepoint site

Expected behavior The webpart to work on hosted workbench and on Sharepoint site webpart.

Environment (please complete the following information):

My package-solution.json:

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
  "solution": {
    "name": "pnp-orgchart-client-side-solution",
    "id": "d76a0c4f-d669-42eb-9533-68d5cec5e9d3",
    "version": "1.1.4.0",
    "includeClientSideAssets": true,
    "skipFeatureDeployment": true,
    "isDomainIsolated": false,
    "webApiPermissionRequests": [
      {
        "resource": "Microsoft Graph",
        "scope": "User.Read.All"
      }
    ]
  },
  "paths": {
    "zippedPackage": "solution/pnp-orgchart.sppkg"
  }
}

My package.json:

{
  "name": "react-tree-orgchart",
  "version": "1.1.0",
  "private": true,
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "build": "gulp bundle",
    "clean": "gulp clean",
    "test": "gulp test"
  },
  "dependencies": {
    "@microsoft/mgt": "^2.5.2",
    "@microsoft/mgt-react": "^2.5.2",
    "@microsoft/mgt-spfx": "^2.5.2",
    "@microsoft/sp-core-library": "1.10.0",
    "@microsoft/sp-lodash-subset": "1.10.0",
    "@microsoft/sp-office-ui-fabric-core": "1.10.0",
    "@microsoft/sp-webpart-base": "1.10.0",
    "@pnp/common": "1.3.11",
    "@pnp/graph": "1.3.11",
    "@pnp/logging": "1.3.11",
    "@pnp/odata": "1.3.11",
    "@pnp/sp": "1.3.11",
    "@pnp/spfx-controls-react": "1.21.1",
    "@pnp/spfx-property-controls": "1.20.0",
    "@types/es6-promise": "0.0.33",
    "@types/react": "16.4.2",
    "@types/react-dom": "16.0.5",
    "@types/webpack-env": "1.13.1",
    "react": "16.3.2",
    "react-dom": "16.3.2",
    "react-sortable-tree": "^2.6.0"
  },
  "resolutions": {
    "@types/react": "16.4.2"
  },
  "devDependencies": {
    "@microsoft/rush-stack-compiler-3.7": "^0.2.3",
    "@microsoft/sp-build-web": "1.10.0",
    "@microsoft/sp-tslint-rules": "1.10.0",
    "@microsoft/sp-module-interfaces": "1.10.0",
    "@microsoft/sp-webpart-workbench": "1.10.0",
    "gulp": "~3.9.1",
    "@types/chai": "3.4.34",
    "@types/mocha": "2.2.38",
    "ajv": "~5.2.2"
  }
}

Additional context I have posted Q here.

I have also tried in the production Sharepoint environment, and my M365 Dev tenant, with clean App Catalog. Same error. The production tenant might have an older version of @mgt-spfx, while the dev tenant is cleaned (both recycle bins) from all previous apps.

EDIT: The solution was working fine until I added a Graph Toolkit component, with the necessary dependencies.

EDIT2: I also have a solution in SPfx 1.1.4.0, which is working on a hosted workbench, but not on a SP site on the same tenant.

ghost commented 2 years ago

Hello tor-axbit, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

sebastienlevert commented 2 years ago

Just to confirm, you installed the mgt-spfx package on your environment? You can see the documentation here :

Before deploying your SharePoint Framework package to your tenant, you will need to deploy the @microsoft/mgt-spfx SharePoint Framework package to your tenant. You can download the package corresponding to the version of @microsoft/mgt-spfx that you used in your project, from the Releases section on GitHub.

https://docs.microsoft.com/en-us/graph/toolkit/get-started/mgt-spfx

I am not able to reproduce the issue. Do you have a repo I could use?

sebastienlevert commented 2 years ago

Also, realizing you should not need @microsoft/mgt in the context of SPFx. Please install @microsoft/mgt-spfx and @microsoft/mgt-react only!

sebastienlevert commented 2 years ago

Adding @waldekmastykarz for any insights here

tabit01 commented 2 years ago

Just to confirm, you installed the mgt-spfx package on your environment? You can see the documentation here :

I did not install the .sppkg in my tenant, thank you! Will check tomorrow and reply.

sebastienlevert commented 2 years ago

You need the .sppkg to be installed as it provides a single source of registration for our web components! Thanks! Let us know!

tabit01 commented 2 years ago

Problem solved, by downloading mgt-spfx-2.5.2.sppkg from Releases section, and uploading to the Sharepoint tenant.