OfficeDev / Office-Addin-TaskPane-React

Template to get start started writing a TaskPane Office Add-in for the React framework using TypeScript
Other
53 stars 34 forks source link

tasks.json config bug #136

Closed hermanwenhe closed 6 months ago

hermanwenhe commented 8 months ago

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Expected behavior

Start Word desktop. I can run npm start:desktop to start Word desktop. The configs in tasks.json seem wrong: image

Current behavior

Can't start Word desktop

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Press F5 after setup

Environments

OS: macOS 14.1.12 Node: 16.17.0 & 18.14.0 (Both fail with same results)

Failure Logs

image

akrantz commented 8 months ago

The -- is used with npm so that the switches afterward apply to the script being run rather than npm itself. This task is to start debugging for the Word app, and therefore specifies the app using --app word.

akrantz commented 8 months ago

It looks like there is some problem where with F5 from VS Code being able to launch properly on Mac. This could potentially be a VS Code problem with how it builds the command line, since it looks wrong to use the double-quotes are the string composed to pass to the npm run command.

millerds commented 8 months ago

This is a bug with VS Code that has been seen before : https://github.com/OfficeDev/generator-office/issues/603. It may be that the bug still exists in Mac. Does moving the cli arguments to an args array work? Maybe that would be the safer option.

hermanwenhe commented 6 months ago

This is a bug with VS Code that has been seen before : OfficeDev/generator-office#603. It may be that the bug still exists in Mac. Does moving the cli arguments to an args array work? Maybe that would be the safer option.

I just tried and moving to args attributes works!

image

But the args shows this: image

@millerds This seems like a workaround anyway. Can you help figuring this out? This seems to block all mac users using F5 to start debugging…

millerds commented 6 months ago

I'm not sure if the args array is supported on the npm type or not, but if it work then good. A suggested option suggested in other places on the web is changing from the 'npm' type to the 'shell' type and using the args array (with 'npm', 'run', and 'start:desktop' as the first arguments in this case).

hermanwenhe commented 6 months ago

@millerds Glad to see we find a workaround. What's the follow-up action on this? I assume all templates should be updated otherwise the mac users' F5 experience are still blocked?

millerds commented 6 months ago

https://github.com/OfficeDev/Office-Addin-TaskPane/pull/232 will eventually get propagated to the other templates.