Azure / azure-sdk-tools

Tools repository leveraged by the Azure SDK team.
MIT License
113 stars 177 forks source link

[SDK Automation] JS fails to build the generated SDK project #7968

Open raych1 opened 7 months ago

raych1 commented 7 months ago

SDK has been generated successfully then it fails in build step. The following is the pipeline log of the spec PR:

01:19:09.895 cmdout     [automation_generate.sh] >>>>>>>>>>>>>>>>>>> Start: "specification/applicationinsights/ApplicationInsights.LiveMetrics" >>>>>>>>>>>>>>>>>>>>>>>>>
01:19:09.895 cmdout     [automation_generate.sh] Run ./eng/common/scripts/TypeSpec-Project-Process.ps1 script directly.
01:19:09.895 cmdout     [automation_generate.sh] pwsh ./eng/common/scripts/TypeSpec-Project-Process.ps1 /mnt/vss/_work/1/s/azure-rest-api-specs/specification/applicationinsights/ApplicationInsights.LiveMetrics 2b27de59d3cbbba841a4ebb05d70206b03a4ebde https://github.com/Azure/azure-rest-api-specs
01:19:12.760 cmdout     [automation_generate.sh] Installing module powershell-yaml with min version 0.4.1 from https://www.powershellgallery.com/api/v2
01:19:14.275 cmdout     [automation_generate.sh] Using module powershell-yaml with version 0.4.7.
01:19:14.719 cmdout     [automation_generate.sh] created service folder /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics
01:19:14.723 cmdout     [automation_generate.sh] created package folder /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest
01:19:14.725 cmdout     [automation_generate.sh] creating tsp-location.yaml in /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest
01:19:14.725 cmdout     [automation_generate.sh] updated tsp-location.yaml commit to 2b27de59d3cbbba841a4ebb05d70206b03a4ebde
01:19:14.725 cmdout     [automation_generate.sh] updated tsp-location.yaml repo to Azure/azure-rest-api-specs
01:19:14.725 cmdout     [automation_generate.sh] updated tsp-location.yaml directory to specification/applicationinsights/ApplicationInsights.LiveMetrics
01:19:14.727 cmdout     [automation_generate.sh] updated tsp-location.yaml additionalDirectories to 
01:19:14.808 cmdout     [automation_generate.sh] finished updating tsp-location.yaml in /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest
01:19:14.809 cmdout     [automation_generate.sh] Calling TypeSpec-Project-Sync.ps1
01:19:14.818 cmdout     [automation_generate.sh] Using module powershell-yaml with version 0.4.7.
01:19:14.820 cmdout     [automation_generate.sh] Reading configuration from /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest/tsp-location.yaml
01:19:14.838 cmdout     [automation_generate.sh] Copying spec from /mnt/vss/_work/1/s/azure-rest-api-specs/specification/applicationinsights/ApplicationInsights.LiveMetrics to /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest/TempTypeSpecFiles
01:19:14.839 cmdout     [automation_generate.sh] Calling TypeSpec-Project-Generate.ps1
01:19:14.852 cmdout     [automation_generate.sh] Using module powershell-yaml with version 0.4.7.
01:19:14.854 cmdout     [automation_generate.sh] Reading configuration from /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest/tsp-location.yaml
01:19:14.876 cmdout     [automation_generate.sh] Generating from /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest/TempTypeSpecFiles/ApplicationInsights.LiveMetrics
01:19:14.878 cmdout     [automation_generate.sh] Copying package.json from /mnt/vss/_work/1/s/azure-sdk-for-js/eng/common/scripts/../../emitter-package.json
01:19:14.879 cmdout     [automation_generate.sh] Copying package-lock.json from /mnt/vss/_work/1/s/azure-sdk-for-js/eng/common/scripts/../../emitter-package-lock.json
01:19:14.884 cmdout     [automation_generate.sh] > npm ci
01:19:17.152 cmdout     [automation_generate.sh] Command succeeded (00:00:02.2639136)
01:19:17.157 cmdout     [automation_generate.sh] npx tsp compile /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest/TempTypeSpecFiles/ApplicationInsights.LiveMetrics/main.tsp --emit @azure-tools/typespec-ts --option @azure-tools/typespec-ts.emitter-output-dir=/mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest/
01:19:19.714 cmdout     [automation_generate.sh] /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest
01:19:19.782 cmdout     [automation_generate.sh] End with ./eng/common/scripts/TypeSpec-Project-Process.ps1 script.
01:19:19.949 cmdout     [automation_generate.sh] Generate some other files for @azure-rest/livemetrics-rest in /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest...
01:19:19.960 cmderr     [automation_generate.sh] [ERROR] Error:
01:19:19.961 cmderr     [automation_generate.sh] [ERROR] An error occurred while run build for typespec project: "specification/applicationinsights/ApplicationInsights.LiveMetrics":
01:19:19.961 cmderr     [automation_generate.sh] [ERROR] Err: Wrong package path /mnt/vss/_work/1/s/azure-sdk-for-js/sdk/applicationinsights.livemetrics/livemetrics-rest;
01:19:19.961 cmderr     [automation_generate.sh] [ERROR] Stderr: "undefined"
01:19:19.961 cmderr     [automation_generate.sh] [ERROR] Stdout: "undefined"
01:19:19.961 cmderr     [automation_generate.sh] [ERROR] ErrorStack: "undefined"
01:19:19.961 cmderr     [automation_generate.sh] [ERROR] Cannot read properties of undefined (reading 'module')
01:19:19.968 error C    Script return with result [failed] code [1] signal [null] cwd [azure-sdk-for-js]: sh .scripts/automation_generate.sh
01:19:19.968 endsection     Call generateScript

@MaryGao

raych1 commented 2 weeks ago

@qiaozha , can you check if this issue has been fixed for JS?