azure-sdk-for-js icon indicating copy to clipboard operation
azure-sdk-for-js copied to clipboard

tshy build failed without full error messages

Open MaryGao opened this issue 1 year ago • 2 comments

Could someone know how to adjust our configuration to show complete error message in tshy?

See pr https://github.com/Azure/azure-sdk-for-js/pull/29513, when I ran the rush update && rush build -t @azure-rest/ai-vision-face I would fail with build steps. But the message didn't clearly show why my code can't pass the build. And it would be helpful when we debug the failure reasons and this also happened in our swagger ci(link).

--[ FAILURE: @azure-rest/ai-vision-face ]--------------------[ 5.63 seconds ]--

writing tsconfig files...
using existing tsconfig.json
building C:\Users\marygao\project\azure-sdk-azure-sdk-for-js\azure-sdk-for-js\sdk\face\ai-vision-face-rest
tshy config {
  exports: { './package.json': './package.json', '.': './src/index.ts' },
  dialects: [ 'esm', 'commonjs' ],
  esmDialects: [ 'browser', 'react-native' ],
  selfLink: false
}
exports {
  ...10 lines omitted...
    import: { types: './dist/esm/index.d.ts', default: './dist/esm/index.js' },
    require: {
      types: './dist/commonjs/index.d.ts',
      default: './dist/commonjs/index.js'
    }
  }
}
set dialect { where: 'src', mode: 'esm' }
building esm
build failed


Operations failed.

Ideally I would like to have following messages.

src/index.ts:11:1 - error TS2308: Module "./parameters.js" has already exported a member named 'CreateLivenessSessionParameters'. Consider explicitly re-exporting to resolve the ambiguity.

11 export * from "./models.js";
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/index.ts:11:1 - error TS2308: Module "./parameters.js" has already exported a member named 'CreateLivenessWithVerifySessionParameters'. Consider explicitly re-exporting to resolve the ambiguity.

11 export * from "./models.js";
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/parameters.ts:10:3 - error TS2440: Import declaration conflicts with local declaration of 'CreateLivenessSessionParameters'.

10   CreateLivenessSessionParameters,
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/parameters.ts:11:3 - error TS2440: Import declaration conflicts with local declaration of 'CreateLivenessWithVerifySessionParameters'.

11   CreateLivenessWithVerifySessionParameters,
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 4 errors in 2 files.

Errors  Files
     2  src/index.ts:11
     2  src/parameters.ts:10
writing tsconfig files...
using existing tsconfig.json
building C:\Users\marygao\project\autorest.typescript\packages\typespec-test\test\faceai\generated\typespec-ts
tshy config {
  exports: { './package.json': './package.json', '.': './src/index.ts' },
  dialects: [ 'esm', 'commonjs' ],
  esmDialects: [ 'browser', 'react-native' ],
  selfLink: false
}

MaryGao avatar Apr 30 '24 01:04 MaryGao

@jeremymeng Not sure if you could help there?

MaryGao avatar Apr 30 '24 02:04 MaryGao

tshy docs mentioned some env var that may help. should we enable more verbose logs for all builds? https://github.com/isaacs/tshy?tab=readme-ov-file#making-noise

jeremymeng avatar Apr 30 '24 15:04 jeremymeng