'Error: Cannot find module 'html' in Outlook module extension
I have created an Outlook add-in supporting SSO feature using yo Office command and now I am trying to add an extension point in the manifest file to add the outlook module extension in the Outlook by following the outlook module extension sample provided in the below link:
Outlook Addin Javascript Module Extension
So far my manifest file code is as given below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xsi:type="MailApp">
<Id>fb33ebc7-071e-40e1-8376-f50538928fd0</Id>
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="OutlookSSO"/>
<Description DefaultValue="An add-in that shows how to use SSO, and to fallback to interactive login when SSO is not available."/>
<IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
<SupportUrl DefaultValue="https://www.contoso.com/help"/>
<AppDomains>
<AppDomain>https://www.contoso.com</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="MailBox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane/taskpane.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read"/>
</Rule>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="residFunctionFileUrl" />
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabHome">
<Group id="CommandsGroup">
<Label resid="CommandsGroup.Label"/>
<Control xsi:type="Button" id="TaskpaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="CommandsGroupRead">
<Label resid="CommandsGroup.Label"/>
<Control xsi:type="Button" id="TaskpaneButtonRead">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<ExtensionPoint xsi:type="Module">
<SourceLocation resid="residExtensionPointUrl" />
<Label resid="residExtensionPointLabel" />
<CommandSurface>
<CustomTab id="idTab">
<Group id="idGroup">
<Label resid="residGroupLabel" />
<Control xsi:type="Button" id="showWebsite">
<Label resid="residChangeToAssociateLabel" />
<Supertip>
<Title resid="residChangeToAssociateLabel" />
<Description resid="residChangeToAssociateDesc" />
</Supertip>
<Icon>
<bt:Image size="16" resid="residAssociateIcon16" />
<bt:Image size="32" resid="residAssociateIcon32" />
<bt:Image size="80" resid="residAssociateIcon80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>getDataforModule</FunctionName>
</Action>
</Control>
</Group>
<Label resid="residCustomTabLabel" />
</CustomTab>
</CommandSurface>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
<bt:Image id="residAddinIcon16" DefaultValue="https://localhost:3000/assets/Executive-16.png" />
<bt:Image id="residAddinIcon32" DefaultValue="https://localhost:3000/assets/Executive-32.png" />
<bt:Image id="residAddinIcon80" DefaultValue="https://localhost:3000/assets/Executive-80.png" />
<bt:Image id="residAssociateIcon16"
DefaultValue="https://localhost:3000/assets/Associate-16.png" />
<bt:Image id="residAssociateIcon32"
DefaultValue="https://localhost:3000/assets/Associate-32.png" />
<bt:Image id="residAssociateIcon80"
DefaultValue="https://localhost:3000/assets/Associate-80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
<bt:Url id="residFunctionFileUrl" DefaultValue="https://localhost:3000/taskpane/Staskpane.html" />
<bt:Url id="residExtensionPointUrl" DefaultValue="https://localhost:3000/" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/>
<bt:String id="CommandsGroup.Label" DefaultValue="Commands Group"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/>
<bt:String id="residExtensionPointLabel"
DefaultValue="Billable Hours" />
<bt:String id="residGroupLabel"
DefaultValue="Change billing rate" />
<bt:String id="residCustomTabLabel"
DefaultValue="Billable hours" />
<bt:String id="residChangeToAssociateLabel"
DefaultValue="Associate" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started."/>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/>
<bt:String id="residVersionOverrideDesc"
DefaultValue="Version override description" />
<bt:String id="residChangeToAssociateDesc"
DefaultValue="Change to the associate billing rate: $127/hr" />
</bt:LongStrings>
</Resources>
<WebApplicationInfo>
<Id>78d9755f-c501-406f-8e68-6881694a8920</Id>
<Resource>api://localhost:3000/78d9755f-c501-406f-8e68-6881694a8920</Resource>
<Scopes>
<Scope>User.Read</Scope>
<Scope>profile</Scope>
</Scopes>
</WebApplicationInfo>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
Now error part, after uploading the add-in in Outlook I am getting below error:
Error: Cannot find module 'html' Require stack:
- D:\OutlookSSO\node_modules\express\lib\view.js
- D:\OutlookSSO\node_modules\express\lib\application.js
- D:\OutlookSSO\node_modules\express\lib\express.js
- D:\OutlookSSO\node_modules\express\index.js
- D:\OutlookSSO\node_modules\office-addin-sso\lib\app.js
- D:\OutlookSSO\node_modules\office-addin-sso\lib\server.js
- D:\OutlookSSO\node_modules\office-addin-sso\lib\commands.js
- D:\OutlookSSO\node_modules\office-addin-sso\lib\cli.js
- D:\OutlookSSO\node_modules\office-addin-sso\cli.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at new View (D:\OutlookSSO\node_modules\express\lib\view.js:81:14) at Function.render (D:\OutlookSSO\node_modules\express\lib\application.js:570:12) at ServerResponse.render (D:\OutlookSSO\node_modules\express\lib\response.js:1012:7) at D:\OutlookSSO\node_modules\office-addin-sso\lib\app.js:60:21 at Layer.handle [as handle_request] (D:\OutlookSSO\node_modules\express\lib\router\layer.js:95:5) at next (D:\OutlookSSO\node_modules\express\lib\router\route.js:137:13)
I am new to Outlook add-in developmentand I am stuck. Any help is highly appreciated. Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
