OfficeDev / generator-office

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

Excel Custom Functions Shared Runtime generator appears out of date and broken #736

Closed rocknet closed 1 year ago

rocknet commented 1 year ago

Prerequisites

Node LTS (as specified in docs): 16.17.1 npm@8.15.0 yo@4.3.0 generator-office@1.9.2

Please answer the following questions before submitting an issue.

Expected behavior

I expected that:

Current behavior

The manifest.xml and webconfig.config.js are not updated, as one would expect if desiring to start off with a new shared runtime prokect. The webpack.config.js, appears to be more up to date with the javascript runtime when compared to the shared runtime option (though I'm no webpack expert). Take the polyfill as an example, in a javascript runtime it's ["core-js/stable", "regenerator-runtime/runtime"], in the shared runtime webpack config it's "@babel/polyfill", which is what it was some time ago. Another (small) example. In the javascript runtime generator, it places a stylesheet with version 11.0.0, in the shared runtime generator, the version is 9.6.1. Further, the package.json in the javascript runtime has an engines node, and items in the dependencies node, whereas the shared runtime package.json does not. All of the devDependencies in the shared runtime package.json are out of date as well.

Apart from all of the above, the npm install at the end of the generator does not work with the shared runtime. I get this:

npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR!     npm login

Note: I do not get this error when running for the javascript runtime.

The error appears to stem from this:

3385 verbose stack HttpErrorAuthUnknown: Unable to authenticate, need: Bearer authorization_uri=https://login.windows.net/npm_***, Basic realm="https://pkgsprodwus21.pkgs.visualstudio.com/", TFS-Federated
3385 verbose stack     at C:\Users\<username>\AppData\Roaming\nvm\v16.17.1\node_modules\npm\node_modules\npm-registry-fetch\lib\check-response.js:78:17
3385 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:96:5)
3386 verbose statusCode 401
3387 verbose pkgid pkg-up@https://office.pkgs.visualstudio.com/_packaging/Office/npm/registry/pkg-up/-/pkg-up-2.0.0.tgz

Steps to Reproduce

  1. Install requirements as stated above, as stated in docs.
  2. Run yo office
  3. Select Excel Custom Functions using a Shared Runtime
  4. Observe error from npm.
  5. Observe files in created directory

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Above.

Comments

Assuming this is reproducible given the latest versions I have used (which is what is recommended in docs), if this is the status of the Shared Runtime option, it should be removed from the generator until it's fixed. It's very unclear why this option exists given it hasn't applied the steps in how to configure for a shared runtime. I'd ask, even if the npm install and webpack bundling worked, what value is it providing?

millerds commented 1 year ago

This should be up to date now.