Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Spontaneous build error without any code changes #11324


User avatar
0
hra created

ANZ v10, AspNetCore + Angular

We are building in Azure Pipelines, using the following command

gulp build && ng build --prod

Our build has been stable for a couple of years. The last successful build was on October 17, then I tried to build today and build failed.

My suspicion is that a dependency been published, and our template uses it - and is causing the build error.

I have proven this is not due to a code change, by queuing a build for a previously successful branch - it now fails with the exact same error.

Here are my logs build logs:

...trimmed for brevity...

2022-11-02T09:08:50.7712455Z Compiling primeng : es2015 as esm2015
2022-11-02T09:11:32.6360136Z 
2022-11-02T09:11:32.6362877Z ERROR in node_modules/@types/lodash/common/object.d.ts:1025:21 - error TS1110: Type expected.
2022-11-02T09:11:32.6363522Z 
2022-11-02T09:11:32.6364013Z 1025         : K extends `${number}`
2022-11-02T09:11:32.6364899Z                          ~~~
2022-11-02T09:11:32.6365743Z node_modules/@types/lodash/common/object.d.ts:1026:19 - error TS1005: ':' expected.
2022-11-02T09:11:32.6366246Z 
2022-11-02T09:11:32.6366974Z 1026             ? '0' extends keyof T
2022-11-02T09:11:32.6367513Z                        ~~~~~~~
2022-11-02T09:11:32.6368336Z node_modules/@types/lodash/common/object.d.ts:1026:33 - error TS1005: ';' expected.
2022-11-02T09:11:32.6368830Z 
2022-11-02T09:11:32.6369674Z 1026             ? '0' extends keyof T
2022-11-02T09:11:32.6370392Z                                      ~
2022-11-02T09:11:32.6371194Z node_modules/@types/lodash/common/object.d.ts:1028:22 - error TS1005: ';' expected.
2022-11-02T09:11:32.6371895Z 
2022-11-02T09:11:32.6372364Z 1028             : number extends keyof T
2022-11-02T09:11:32.6373028Z                           ~~~~~~~
2022-11-02T09:11:32.6374281Z node_modules/@types/lodash/common/object.d.ts:1028:36 - error TS1005: ';' expected.
2022-11-02T09:11:32.6374800Z 
2022-11-02T09:11:32.6375325Z 1028             : number extends keyof T
2022-11-02T09:11:32.6376348Z                                         ~
2022-11-02T09:11:32.6377703Z node_modules/@types/lodash/common/object.d.ts:1031:13 - error TS1128: Declaration or statement expected.
2022-11-02T09:11:32.6379458Z 
2022-11-02T09:11:32.6380388Z 1031             : undefined;
2022-11-02T09:11:32.6381201Z                  ~

...trimmed for brevity... (just more similar errors as above)...

2022-11-02T09:11:32.6567947Z      
2022-11-02T09:11:32.6568021Z 
2022-11-02T09:11:32.7143043Z npm ERR! code ELIFECYCLE
2022-11-02T09:11:32.7143478Z npm ERR! errno 1
2022-11-02T09:11:32.7185919Z npm ERR! [email protected] publish: `gulp build && ng build --prod`
2022-11-02T09:11:32.7188823Z npm ERR! Exit status 1
2022-11-02T09:11:32.7189483Z npm ERR! 
2022-11-02T09:11:32.7190590Z npm ERR! Failed at the [email protected] publish script.
2022-11-02T09:11:32.7191504Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-11-02T09:11:32.7273029Z 
2022-11-02T09:11:32.7273658Z npm ERR! A complete log of this run can be found in:
2022-11-02T09:11:32.7275074Z npm ERR!     /home/vsts/.npm/_logs/2022-11-02T09_11_32_719Z-debug.log
2022-11-02T09:11:32.7354536Z cp: cannot create regular file './dist/': Not a directory
2022-11-02T09:11:32.7453705Z ##[error]Bash exited with code '1'.
2022-11-02T09:11:32.7523473Z ##[section]Finishing: npm install and build

1 Answer(s)
  • User Avatar
    0
    hra created

    Nevermind - offending change found!

    An update to @types/lodash - version 4.14.187 published Nov 1, 2022 caused the breakage. It forced a dependency on TypeScript 4.1 functionality

    https://github.com/DefinitelyTyped/DefinitelyTyped/issues/63022