OfficeDev / generator-office

Yeoman generator for building Microsoft Office related projects.
https://www.npmjs.com/package/generator-office
MIT License
841 stars 208 forks source link

New SSO project fails on "npm start" with multiple "UnhandledPromiseRejectionWarning", #614

Closed andrewconnell closed 3 years ago

andrewconnell commented 3 years ago

NOTE: I checked the existing issues & see multiple other issues (such as #539 & #599), but none had the exact same result, so adding this.

Expected behavior

Project to start up and run to test the OOTB addin created by the Yeoman Office generator..

Current behavior

Addin project fails on startup... local processes exit without giving an option to test. May be related to #613

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Follow steps in to create project & configure SSO: https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/sso-quickstart
  2. After creating the project, run npm start
  3. Wait until Word fires up... before Word can start (ultimately it does), notice in the console two messages that two of the commands triggered by npm start prematurely exited.

Context

Failure Logs

Notice the last two lines in the following where you can see the two processes exit prematurely. Before those, notice the Node errors.

~/_play/My SSO Addin2 is 📦 v0.0.0 via ⬢ v14.5.0 took 1m 32s
➜ npm start

> office-addin-taskpane-sso-js@0.0.0 start /Users/ac/_play/My SSO Addin2
> npm run build:dev && concurrently "npm run start:server" "npm run sideload"

> office-addin-taskpane-sso-js@0.0.0 build:dev /Users/ac/_play/My SSO Addin2
> webpack --mode development --https false

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Hash: b85a2b123f317e868689
Version: webpack 4.43.0
Time: 3402ms
Built at: 03/02/2021 4:00:01 PM
                    Asset       Size              Chunks                   Chunk Names
   assets/logo-filled.png   11.6 KiB                      [emitted]
            commands.html  471 bytes                      [emitted]
              commands.js   5.95 KiB            commands  [emitted]        commands
          commands.js.map   6.26 KiB            commands  [emitted] [dev]  commands
  fallbackauthdialog.html  801 bytes                      [emitted]
    fallbackauthdialog.js    355 KiB  fallbackauthdialog  [emitted]        fallbackauthdialog
fallbackauthdialog.js.map    341 KiB  fallbackauthdialog  [emitted] [dev]  fallbackauthdialog
         manifest.dev.xml   4.39 KiB                      [emitted]
              polyfill.js    402 KiB            polyfill  [emitted]        polyfill
          polyfill.js.map    322 KiB            polyfill  [emitted] [dev]  polyfill
             taskpane.css    1.7 KiB                      [emitted]
            taskpane.html   3.83 KiB                      [emitted]
              taskpane.js    560 KiB            taskpane  [emitted]        taskpane
          taskpane.js.map    683 KiB            taskpane  [emitted] [dev]  taskpane
Entrypoint commands = commands.js commands.js.map
Entrypoint polyfill = polyfill.js polyfill.js.map
Entrypoint taskpane = taskpane.js taskpane.js.map
Entrypoint fallbackauthdialog = fallbackauthdialog.js fallbackauthdialog.js.map
[0] util (ignored) 15 bytes {taskpane} [built]
[1] util (ignored) 15 bytes {taskpane} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {commands} {taskpane} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {taskpane} [built]
[./src/commands/commands.js] 1.03 KiB {commands} [built]
[./src/helpers/documentHelper.js] 3.46 KiB {taskpane} [built]
[./src/helpers/fallbackAuthHelper.js] 3.3 KiB {taskpane} [built]
[./src/helpers/fallbackauthdialog.js] 2.55 KiB {fallbackauthdialog} [built]
[./src/helpers/ssoauthhelper.js] 4.1 KiB {taskpane} [built]
[./src/taskpane/taskpane.js] 432 bytes {taskpane} [built]
    + 392 hidden modules
Child HtmlWebpackCompiler:
                     Asset      Size  Chunks             Chunk Names
    assets/logo-filled.png  11.6 KiB          [emitted]
     + 3 hidden assets
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    Entrypoint HtmlWebpackPlugin_1 = __child-HtmlWebpackPlugin_1
    Entrypoint HtmlWebpackPlugin_2 = __child-HtmlWebpackPlugin_2
    [./assets/logo-filled.png] 68 bytes {HtmlWebpackPlugin_0} [built]
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/commands/commands.html] 448 bytes {HtmlWebpackPlugin_1} [built]
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/helpers/fallbackauthdialog.html] 779 bytes {HtmlWebpackPlugin_2} [built]
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/taskpane/taskpane.html] 3.98 KiB {HtmlWebpackPlugin_0} [built]
[0]
[0] > office-addin-taskpane-sso-js@0.0.0 start:server /Users/ac/_play/My SSO Addin2
[0] > office-addin-sso start manifest.xml
[0]
[1]
[1] > office-addin-taskpane-sso-js@0.0.0 sideload /Users/ac/_play/My SSO Addin2
[1] > office-addin-debugging start manifest.xml
[1]
[0] (node:27828) UnhandledPromiseRejectionWarning: false
[0] (Use `node --trace-warnings ...` to show where the warning was created)
[0] (node:27828) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[0] (node:27828) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[1] Debugging is being started...
[1] App type: desktop
[1] Sideloading the Office Add-in...
[1] Debugging started.
[0] npm run start:server exited with code 0
[1] npm run sideload exited with code 0

~/_play/My SSO Addin2 is 📦 v0.0.0 via ⬢ v14.5.0 took 27s
andrewconnell commented 3 years ago

Appears this is due to spaces in the project name... deduced from https://github.com/OfficeDev/generator-office/issues/539#issuecomment-741939945. Need to get the PR https://github.com/OfficeDev/Office-Addin-Scripts/pull/351 merged to fix this issue.

Recreated the exact same project with the name MySSOAddin3 & worked fine.

KhalilMohammad commented 3 years ago

I created a typescript powerpoint sso project with the name power-point-charts. I am getting npm run start:server exited with code 0