2

I spent couple of days trying to find the reasons why I can't seem to get yo office template` to be funcioning properly. I read the following guid like 20 times https://learn.microsoft.com/en-us/office/dev/add-ins/tutorials/excel-tutorial trying to figure out what am I doing wrong, I tried updating all the packages inside the template to the latest ones result is the same. Tried to uninstall and reinstall office but each time when I try to the following:

npm run dev-server; npm run start

or

npm run build; npm run start

or just

npm start

It does open excel and loads the plugin, but if I try to change at list a letter in the code this is what happens.

enter image description here

or something like this

ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts
./src/taskpane/taskpane.ts 37:33-36
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts(37,34)
      TS2304: Cannot find name 'add'.

ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts
./src/taskpane/taskpane.ts 38:35-40
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts(38,36)
      TS2304: Cannot find name 'clock'.

ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts
./src/taskpane/taskpane.ts 39:39-48
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts(39,40)
      TS2304: Cannot find name 'increment'.

ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts
./src/taskpane/taskpane.ts 40:33-43
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\taskpane\taskpane.ts(40,34)
      TS2552: Cannot find name 'logMessage'. Did you mean 'onmessage'?

ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts
./src/commands/commands.ts 46:33-36
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts(46,34)
      TS2304: Cannot find name 'add'.

ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts
./src/commands/commands.ts 47:35-40
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts(47,36)
      TS2304: Cannot find name 'clock'.

ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts
./src/commands/commands.ts 48:39-48
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts(48,40)
      TS2304: Cannot find name 'increment'.

ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts
./src/commands/commands.ts 49:33-43
[tsl] ERROR in C:\Users\asolo\git\excel-fn\src\commands\commands.ts(49,34)
      TS2552: Cannot find name 'logMessage'. Did you mean 'onmessage'?

8 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

I how can I get this dev environment to get working?

I have setup test repo here

Here is my specs:

Edition Windows 10 Pro
Version 21H2
Installed on    ‎14-‎Apr-‎22
OS build    19044.1889
Experience  Windows Feature Experience Pack 120.2212.4180.0
Office 365 Business
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Andrius Solopovas
  • 967
  • 11
  • 41

1 Answers1

0

Your expectations don't correspond to the actions made for running the Office add-in. By using the following commands:

npm run dev-server; npm run start

A local development server is started (if it's not already running) and Excel is opened with your add-in loaded. But to be able to debug your add-in you need to install a VSCode extension - Add-in Debugger Extension for Visual Studio Code. You can read more about that in the Overview of debugging Office Add-ins article.

but if I try to change at list a letter in the code this is what happens

Any changes you make in the source code are automatically reflected (i.e. built) and the web server is updated, so if they contain mistakes you may get such pictures with error statements explaining a possible problem and place where it is.

Be aware, Office Add-ins should use HTTPS, not HTTP, even when you are developing. If you are prompted to install a certificate after you run one of the following commands, accept the prompt to install the certificate that the Yeoman generator provides. You may also have to run your command prompt or terminal as an administrator for the changes to be made.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • I have the plugin installed, I just want to be able to change text in html file and have it reflected in the excel, non of the options I chosen gave me that ability, tutorial videos show things working when I started it I get the errors. Which options I have to chose for that? – Andrius Solopovas Aug 14 '22 at 14:10
  • If I do npm run watch I get strange loop https://i.imgur.com/Bup2A9M.gif – Andrius Solopovas Aug 14 '22 at 14:14
  • If I just start dev server than add the addin inside the excel application and do a change the errors shown above popup – Andrius Solopovas Aug 14 '22 at 14:35
  • There is no need to run the `watch` command. Typescript and webpack handles everything for you. – Eugene Astafiev Aug 14 '22 at 15:00
  • Do you get errors with any other scaffolded Office add-in project? – Eugene Astafiev Aug 14 '22 at 15:01
  • I tried recreating excel function with typescript project like 20 times, and every time when I run any of the tasks on two computers I get similar results. Either on change I get the errors thrown (discussed above) or behaviour that looks like this https://i.imgur.com/xeD3v5N.gif – Andrius Solopovas Aug 14 '22 at 15:28
  • I also tried shared runtime, javascript only, its just like this template doesn't want me to create anything for excel... or maybe be I am to stupid to figure it out. Each time when I have to play with webpack, or any other bundler it steals days of my life trying to find the issue. – Andrius Solopovas Aug 14 '22 at 15:30