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

TypeScript compilation fails in azure-rest-api-specs pipelines #6109

Closed
mikeharder opened this issue May 6, 2023 · 0 comments · Fixed by Azure/azure-rest-api-specs#25673
Closed
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.

Comments

@mikeharder
Copy link
Member

The following code was recently added to the root package.json in https://github.com/azure/azure-rest-api-specs:

  "scripts": {
    "postinstall": "tsc"
  },

https://github.com/Azure/azure-rest-api-specs/pull/23763/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R21

This was added to improve the experience on dev machines, by compiling the scripts in the repo after running npm install.

However, this causes failures in the unified pipeline:

stdout: 
> postinstall
> tsc

../../../scripts/repo-sync/common.ts(2,21): error TS7016: Could not find a declaration file for module 'nodegit'. '/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/nodegit/lib/nodegit.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/nodegit` if it exists or add a new declaration (.d.ts) file containing `declare module 'nodegit';`

https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2753855&view=logs&j=e37a1bb9-a190-5269-3a0e-37469dfbe682&t=09cb0672-20c5-5dce-4552-dad3f3e96fd3

The failure is caused by the scripts/repo-sync folder in the openapi-alps repo unable to be successfully compiled, at least using the version of TypeScript in the azure-rest-api-specs repo.

As a temporary fix, I have removed the postinstall: tsc lines in Azure/azure-rest-api-specs#23837.

Better long-term fixes:

  • Align the TypeScript versions and ensure the code from openapi-alps compiles when copied into azure-rest-api-specs
  • Reduce the set of folders compiled in the preinstall script, to only those needed for local dev machine work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.
Projects
Archived in project
Status: 🎊 Closed
Development

Successfully merging a pull request may close this issue.

2 participants