简体   繁体   English

如何对使用 Node.js 和 Yeoman 创建的 Javascript Office 插件 (OneNote) 进行故障排除?

[英]How do I troubleshoot an Javascript Office Addin (OneNote) created using Node.js and Yeoman?

I might be in way over my head but I thought this basic example should be easy to follow and test https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/onenote-quickstar我可能有点不知所措,但我认为这个基本示例应该很容易理解和测试https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/onenote-quickstar

Node.js and npm were installed correctly Node.js 和 npm 安装正确
The server started OK服务器启动正常
The add in manifesto was uploaded and shows up in the task pane When I click run Nothing happens宣言中的添加已上传并显示在任务窗格中当我单击运行时没有任何反应

C:\Users\minime\Documents\VSCode\JavaScript\OneNote Add-in>npm run start:web

> office-addin-taskpane-js@0.0.1 start:web C:\Users\minime\Documents\VSCode\JavaScript\OneNote Add-in
> office-addin-debugging start manifest.xml web

Debugging is being started...
App type: web
Starting the dev server... (webpack-dev-server --mode development)
The dev server is running on port 3000. Process id: 12728
Debugging started.

C:\Users\minime\Documents\VSCode\JavaScript\OneNote Add-in>

The server console shows these服务器控制台显示这些

You already have trusted access to https://localhost.
Certificate: C:\Users\minime\.office-addin-dev-certs\localhost.crt
Key: C:\Users\minime\.office-addin-dev-certs\localhost.key
i 「wds」: Project is running at https://localhost:3000/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\minime\Documents\VSCode\JavaScript\OneNote Add-in
i 「wdm」: Hash: 36810652b543e5f942db
Version: webpack 4.42.1
Time: 3436ms
Built at: 06/06/2020 9:18:01 AM
                               Asset       Size    Chunks                   Chunk Names
7f313c06a52dabe7267420021403d038.png   11.6 KiB            [emitted]
                       commands.html  473 bytes            [emitted]
                         commands.js    348 KiB  commands  [emitted]        commands
                     commands.js.map    398 KiB  commands  [emitted] [dev]  commands
                         polyfill.js    745 KiB  polyfill  [emitted]        polyfill
                     polyfill.js.map    714 KiB  polyfill  [emitted] [dev]  polyfill
                        taskpane.css   1.48 KiB            [emitted]
                       taskpane.html   2.52 KiB            [emitted]
                         taskpane.js    348 KiB  taskpane  [emitted]        taskpane
                     taskpane.js.map    397 KiB  taskpane  [emitted] [dev]  taskpane
Entrypoint polyfill = polyfill.js polyfill.js.map
Entrypoint taskpane = taskpane.js taskpane.js.map
Entrypoint commands = commands.js commands.js.map
[0] multi (webpack)-dev-server/client?https://localhost:3000 @babel/polyfill 40 bytes {polyfill} [built]
[1] multi (webpack)-dev-server/client?https://localhost:3000 ./src/taskpane/taskpane.js 40 bytes {taskpane} [built]
[2] multi (webpack)-dev-server/client?https://localhost:3000 ./src/commands/commands.js 40 bytes {commands} [built]
[./node_modules/@babel/polyfill/lib/index.js] 686 bytes {polyfill} [built]
[./node_modules/@babel/polyfill/lib/noConflict.js] 567 bytes {polyfill} [built]
[./node_modules/core-js/library/fn/global.js] 87 bytes {polyfill} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {polyfill} {taskpane} {commands} [built]
[./node_modules/webpack-dev-server/client/index.js?https://localhost:3000] (webpack)-dev-server/client?https://localhost:3000 4.29 KiB {polyfill} {taskpane} {commands} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {polyfill} {taskpane} {commands} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {polyfill} {taskpane} {commands} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {polyfill} {taskpane} {commands} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {polyfill} {taskpane} {commands} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {polyfill} {taskpane} {commands} [built]
[./src/commands/commands.js] 1.06 KiB {commands} [built]
[./src/taskpane/taskpane.js] 1.54 KiB {taskpane} [built]
    + 328 hidden modules
Child HtmlWebpackCompiler:
                                   Asset      Size  Chunks             Chunk Names
    7f313c06a52dabe7267420021403d038.png  11.6 KiB          [emitted]
     + 2 hidden assets
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    Entrypoint HtmlWebpackPlugin_1 = __child-HtmlWebpackPlugin_1
    [./assets/logo-filled.png] 82 bytes {HtmlWebpackPlugin_0} [built]
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/commands/commands.html] 450 bytes {HtmlWebpackPlugin_1} [built]
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/taskpane/taskpane.html] 2.61 KiB {HtmlWebpackPlugin_0} [built]
i 「wdm」: Compiled successfully.

The addin manifesto was loaded in the OneNote Online插件宣言已加载到 OneNote Online

在此处输入图像描述

Turns out it was a beginner's mistake As per the tutorial you need to change your taskpane.js code AND SAVE IT!原来这是初学者的错误根据教程,您需要更改 taskpane.js 代码并保存它! (which I did not) (我没有)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 node.js GOT http 请求库进行故障排除? - how to troubleshoot using the node.js GOT http request library? 如何使用 OneNote Javascript API 阅读 OneNote 缩进段落? - How do I read OneNote indented paragraphs using OneNote Javascript APIs? 如何使用office.js Excel插件中的行和列号获取完整的Excel范围地址? - How do I get an full Excel range address using row and column numbers in office.js Excel Addin? 如何在 javascript/Node.js 中获取一天中的时间? - How do I get the time of day in javascript/Node.js? 如何使用 node.js 读取一系列 JavaScript 文字? - how do I read a series of JavaScript literals with node.js? 如何在 node.js 中使用这个 javascript 库? - How do I utilize this javascript library in node.js? 在Node.js中如何与客户端JavaScript通信? - In Node.js how do I communicate with client side JavaScript? 使用Javascript node.js如何并行处理For循环? - Using Javascript node.js how do I parallel process For loops? 如何使用 Javascript/Node.js 从网站获取 object? - How do I grab an object from a website using Javascript/Node.js? 如何在 Javascript node.js 中使用正则表达式对多个值进行验证 - How do I create validation on multiple values using regex in Javascript node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM