Hello i have an issue with one of my Jenkins pipelines when trying to build a TypeScript application.
The pipeline checkouts the TypeScript project and runs:
yarn install
yarn build
However during the build i errors and the pipeline fails with the error:
ā TS2571: Object is of type 'unknown'.
I tried to recreate this error on an AWS EC2 instance which uses the same AMI image as my Jenkins EC2. I made sure to use the same version of node (v12.22.3) that my Jenkins service is using. However after running yarn install + build, I don't get this error. And the build succeeds.
I can see the error in Jenkins logs is referring to an 'error' variable:
} catch (error) {
expect(error.name).toEqual('Error');
}
And after googling this error it seems like the solution could be to update the code to include a type on the error object (due to a TypeScript update), however this isn't my code, i'm not a typescript dev, and i know the code builds on my VM using the same version as node.js. So surely i can get it to work on Jenkins?
Does any one have any tips to help debug this? Thanks