Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source file is corrupted when fetched from the Office-Addin-Taskpane-SSO repo #811

Open
Rick-Kirkham opened this issue Feb 10, 2024 · 2 comments

Comments

@Rick-Kirkham
Copy link
Contributor

Prerequisites

Please answer the following questions before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • [x ] I am running the latest version of Node and the tools
  • [x ] I checked the documentation and found no answer
  • [x ] I checked to make sure that this issue has not already been filed

Expected behavior

No files are corrupted.

Current behavior

When a project is created taking the SSO and TypeScript options (and any host), the file \src\middle-tier\ssoauth-helper.ts is corrupt. Specifically, the first 15 lines and most of line 16 are deleted.

The following is line 16 as it appears in the repo. In the generated project, everything except the string e<any> { at the end is deleted and all lines above this one are deleted.

export async function getAccessToken(authorization: string): Promise<any> {

This breaks the project.

I can reproduce this on multiple machines and several versions of Node.js in the 18.x.x and 20.x.x ranges. It happens in both a Command Prompt and a git bash.

If I clone the template repo and manually test the convertToSingleHost.js file, the file is not corrupted, so I think it must happen when the file is fetched from the repo by the generator.

If I take the JavaScript option, the resulting project is fine. The corresponding JS file, ssoauth-helper.js, is not corrupted.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Install latest Yo Office.
  2. Run it.
  3. Select the SSO option.
  4. Select TypeScript.
  5. Give it any name you want.
  6. Choose any host you want.
  7. When the project is generated, the ssoauth-helper.ts file is corrupt as described above.

Context

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

  • Operating System: Windows
  • Node version: 18.16.1, 18.19.0, 20.9.0, and 20.11.0
  • Office version: N/A
  • Tool version: fresh install of the latest

Failure Logs

Please include any relevant log snippets, screenshots or code samples here.

@millerds
Copy link
Contributor

You'll find those missing lines at the end of the file (they should be moved to the top). This looks like a problem with newer versions of node (18.16+) the package we are using to unzip the templates files downloaded from the github repo they are stored in (see the posts linked to bellow). We are tracking work to fix this internally (item: 8084264) but can't promise the timeline to fix it.

@millerds millerds reopened this Feb 17, 2024
@Rick-Kirkham
Copy link
Contributor Author

Documented here: 4425

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants