generator-office icon indicating copy to clipboard operation
generator-office copied to clipboard

"missing script" error in default Word TaskPane project

Open Shujee opened this issue 2 years ago • 4 comments

This issue has been raised before, but has been marked Fixed in VSCode 1.53.2. However I'm seeing this in 1.63.2 (latest).

The default TaskPane project for Word (Typescript) shows the following "missing script" message when I try to run it (Word desktop: Edge Chromium):

Executing task: npm run "start:desktop -- --app word" <

npm ERR! Missing script: "start:desktop -- --app word"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shujaat\AppData\Local\npm-cache\_logs\2021-12-30T07_03_36_703Z-debug.log
The terminal process "C:\Program Files\Git\bin\bash.exe '--login', '-c', 'npm run "start:desktop -- --app word"'" terminated with exit code:  1

Steps to Reproduce

  1. Just run yo office in an empty folder. Choose Word, Typescript and Task Pane options.
  2. Choose Word desktop: Edge Chromium from debug dropdown and click Run.,
  3. You get it.

Context

  • Windows 11 (10.0.22000.376)
  • Node: 16.13.1
  • Office version: 2019 Standard Desktop (2111 Build 16.0.14701.20240) - 32-bit
  • Tool version: VS Code 1.63.2

Shujee avatar Dec 30 '21 07:12 Shujee

So I'm not getting this with those basic steps. However, I see that you are using 32-bit Office 2019 with Windows 11 while my current setup is Windows 10 with current O365. We have had one other report that looks like an issue with add-ins in 32-bit Office (O365 version) on Windows 11. Using 64-bit didn't have a problem.

But, your error doesn't look related to OS or Office version (if you able try a different combo that might verify that . . . but I will try setting that up too). Can you provide me with the word edge chromium section of the launch.json file and the scripts section of your package.json file?

millerds avatar Jan 04 '22 00:01 millerds

Sure. Here is Word Edge Chromium part of launch.json:

 {
  "name": "Word Desktop (Edge Chromium)",
  "type": "edge",
  "request": "attach",
  "useWebView": "advanced",
  "port": 9229,
  "timeout": 600000,
  "webRoot": "${workspaceRoot}",
  "preLaunchTask": "Debug: Word Desktop",
  "postDebugTask": "Stop Debug"
}

Here is the task definition in tasks.json:

{
  "label": "Debug: Word Desktop",
  "type": "npm",
  "script": "start:desktop -- --app word",
  "presentation": {
    "clear": true,
    "panel": "dedicated",
  },
  "problemMatcher": []
}

and here is the scripts section of package.json:

 "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",
	  "start": "office-addin-debugging start manifest.xml",
	  "start:desktop": "office-addin-debugging start manifest.xml desktop",
	  "start:web": "office-addin-debugging start manifest.xml web",
	  "stop": "office-addin-debugging stop manifest.xml",
	  "validate": "office-addin-manifest validate manifest.xml",
	  "watch": "webpack --mode development --watch"
  }

Removing the -- --app word part from tasks.json fixes the problem for me, so it really looks like an issue with passing parameters to the command.

Shujee avatar Jan 04 '22 03:01 Shujee

The problem looks related to the quotes around the entire string. Rather than looking for a script named "start:desktop", it's looking for a script with the entire string. Is the way you're executing it causing it to treat the whole command line as one parameter?

akrantz avatar May 02 '22 14:05 akrantz

I have not been able to get a win 11 test environment to try 32 bit on, but I can say the VS Code had some updated that cause the debug configs to need to be updated so previously mentioned config will not work.

@Shujee can you try with current yo office output to see if you encounter the same problem?

millerds avatar Jun 14 '22 21:06 millerds

I think this was fixed or is a bug in VS Code and not the templates.

millerds avatar May 22 '23 19:05 millerds