OfficeDev / generator-office

Yeoman generator for building Microsoft Office related projects.
https://www.npmjs.com/package/generator-office
MIT License
837 stars 208 forks source link

npm start:desktop script does not exist #847

Open arbass22 opened 8 hours ago

arbass22 commented 8 hours ago

Expected behavior

I can follow the quickstart guide here to get an outlook add in with react working.

Current behavior

After following the directions the package.json does not contain a script for npm start:desktop

Steps to Reproduce

``bash $ npm install -g yo generator-office $ yo office

outlook yo office

? Choose a project type: Office Add-in Task Pane project using React framework ? Choose a script type: TypeScript ? What do you want to name your add-in? poka-outlook ? Which Office client application would you like to support? Outlook ? Which manifest type would you like to use? unified manifest for Microsoft 365

`` See above to install. npm start failed so I tried the instructions here: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/sideload-outlook-add-ins-for-testing#sideload-manually

Which say to run npm start:desktop which is not a command that exists in my package.json that was generated:

{
  "name": "office-addin-taskpane-react",
  "version": "0.0.1",
  "repository": {
    "type": "git",
    "url": "https://github.com/OfficeDev/Office-Addin-TaskPane-React.git"
  },
  "license": "MIT",
  "config": {
    "app_to_debug": "outlook",
    "app_type_to_debug": "desktop",
    "dev_server_port": 3000
  },
  "scripts": {
    "build": "webpack --mode production",
    "build:dev": "webpack --mode development",
    "dev-server": "webpack serve --mode development",
    "lint": "office-addin-lint check",
    "lint:fix": "office-addin-lint fix",
    "prettier": "office-addin-lint prettier",
    "signin": "office-addin-dev-settings m365-account login",
    "signout": "office-addin-dev-settings m365-account logout",
    "start": "office-addin-debugging start manifest.json",
    "stop": "office-addin-debugging stop manifest.json",
    "validate": "office-addin-manifest validate manifest.json",
    "watch": "webpack --mode development --watch"
  },
  "dependencies": {
    "@fluentui/react-components": "^9.46.8",
    "@fluentui/react-icons": "^2.0.232",
    "core-js": "^3.36.0",
    "es6-promise": "^4.2.8",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "regenerator-runtime": "^0.14.1"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@babel/preset-env": "^7.25.4",
    "@babel/preset-typescript": "^7.23.3",
    "@types/office-js": "^1.0.377",
    "@types/office-runtime": "^1.0.35",
    "@types/react": "^18.2.64",
    "@types/react-dom": "^18.2.21",
    "@types/webpack": "^5.28.5",
    "acorn": "^8.11.3",
    "babel-loader": "^9.1.3",
    "copy-webpack-plugin": "^12.0.2",
    "eslint-plugin-office-addins": "^3.0.2",
    "eslint-plugin-react": "^7.28.0",
    "file-loader": "^6.2.0",
    "html-loader": "^5.0.0",
    "html-webpack-plugin": "^5.6.0",
    "less": "^4.2.0",
    "less-loader": "^12.2.0",
    "office-addin-cli": "^1.6.5",
    "office-addin-debugging": "^5.1.6",
    "office-addin-dev-certs": "^1.13.5",
    "office-addin-lint": "^2.3.5",
    "office-addin-manifest": "^1.13.6",
    "office-addin-prettier-config": "^1.2.1",
    "os-browserify": "^0.3.0",
    "process": "^0.11.10",
    "source-map-loader": "^5.0.0",
    "ts-loader": "^9.5.1",
    "typescript": "^5.4.2",
    "webpack": "^5.95.0",
    "webpack-cli": "^5.1.4",
    "webpack-dev-server": "5.1.0"
  },
  "prettier": "office-addin-prettier-config",
  "browserslist": [
    "last 2 versions",
    "ie 11"
  ]
}

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

If I run npm start I get these logs

➜  poka-outlook npm start

> office-addin-taskpane-react@0.0.1 start
> office-addin-debugging start manifest.json

Debugging is being started...
App type: desktop
The dev server is already running on port 3000.
Sideloading the Office Add-in...
Manifest package saved to /var/folders/t3/sdfgh88d3hg6s7nbbn7rcdgw0000gn/T/manifest.zip
running: npx @microsoft/teamsapp-cli install --file-path "/var/folders/t3/sdfgh88d3hg6s7nbbn7rcdgw0000gn/T/manifest.zip"

Using account andrew@pokalabs.com

--Error sideloading!--
Error: Error: Command failed: npx @microsoft/teamsapp-cli install --file-path "/var/folders/t3/sdfgh88d3hg6s7nbbn7rcdgw0000gn/T/manifest.zip"
(✖) Error: m365.InternalError: Request failed with status code 404 (tracingId: 00-ec217fd98baa186d10d5f3aba6c682bb-46a0d0efa6fd1ae3-00) :

STDERR:
(✖) Error: m365.InternalError: Request failed with status code 404 (tracingId: 00-ec217fd98baa186d10d5f3aba6c682bb-46a0d0efa6fd1ae3-00) :

Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in.
Error: Unable to register the Office Add-in.
Error: Command failed: npx @microsoft/teamsapp-cli install --file-path "/var/folders/t3/sdfgh88d3hg6s7nbbn7rcdgw0000gn/T/manifest.zip"
(✖) Error: m365.InternalError: Request failed with status code 404 (tracingId: 00-ec217fd98baa186d10d5f3aba6c682bb-46a0d0efa6fd1ae3-00) :

Please include any relevant log snippets, screenshots or code samples here.

arbass22 commented 7 hours ago

Don't this its the root issue here but it looks like according to this page, the unified manifest is not supported for Mac Outlook: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/yeoman-generator-overview If that's the case, that really should be mentioned in this guide: https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/outlook-quickstart-yo