1 year ago
#248412
mrahman10
React App build failing suddenly on devops pipeline
We have a react app which we build at least daily using Azure devops pipeline, which was building fine until Tuesday. The app still builds fine locally. We have had several build issues in the past which have not been related to any code change but annoyingly something has changed on the build environment (e.g. node version, which I've permanently fixed now). Anyway, this problem has got me stumped, it seems to be related to typescript errors which were not picked up before (and aren't still not locally). Please note I went back to a previously building changeset and that even fails just to prove its not code change. So the following is a copy of the logs:
022-03-03T12:57:33.1308454Z ##[section]Starting: npm run build
2022-03-03T12:57:33.1430151Z ==============================================================================
2022-03-03T12:57:33.1430464Z Task : npm
2022-03-03T12:57:33.1430786Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Azure Artifacts.
2022-03-03T12:57:33.1431118Z Version : 1.198.0
2022-03-03T12:57:33.1431337Z Author : Microsoft Corporation
2022-03-03T12:57:33.1431608Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/package/npm
2022-03-03T12:57:33.1431939Z ==============================================================================
2022-03-03T12:57:34.0466991Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\node\14.18.1\x64\npm.cmd --version"
2022-03-03T12:57:34.6075468Z 6.14.15
2022-03-03T12:57:36.0928973Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\node\14.18.1\x64\npm.cmd config list"
2022-03-03T12:57:36.4071872Z ; cli configs
2022-03-03T12:57:36.4072698Z metrics-registry = "https://registry.npmjs.org/"
2022-03-03T12:57:36.4073130Z scope = ""
2022-03-03T12:57:36.4073512Z user-agent = "npm/6.14.15 node/v14.18.1 win32 x64"
2022-03-03T12:57:36.4073764Z
2022-03-03T12:57:36.4074071Z ; environment configs
2022-03-03T12:57:36.4074412Z prefix = "C:\\npm\\prefix"
2022-03-03T12:57:36.4074795Z userconfig = "D:\\a\\1\\npm\\9029.npmrc"
2022-03-03T12:57:36.4075009Z
2022-03-03T12:57:36.4075341Z ; project config D:\a\1\s\.npmrc
2022-03-03T12:57:36.4076782Z @rentchief:registry = "https://pkgs.dev.azure.com/RentChief/_packaging/Rent-Chief/npm/registry/"
2022-03-03T12:57:36.4077254Z always-auth = true
2022-03-03T12:57:36.4077617Z registry = "https://registry.npmjs.org/"
2022-03-03T12:57:36.4077857Z
2022-03-03T12:57:36.4078204Z ; globalconfig C:\npm\prefix\etc\npmrc
2022-03-03T12:57:36.4078562Z cache = "C:\\npm\\cache"
2022-03-03T12:57:36.4078751Z
2022-03-03T12:57:36.4079153Z ; node bin location = C:\hostedtoolcache\windows\node\14.18.1\x64\node.exe
2022-03-03T12:57:36.4079567Z ; cwd = D:\a\1\s
2022-03-03T12:57:36.4079922Z ; HOME = C:\Users\VssAdministrator
2022-03-03T12:57:36.4080402Z ; "npm config ls -l" to show all defaults.
2022-03-03T12:57:36.4080627Z
**2022-03-03T12:57:36.4085149Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\node\14.18.1\x64\npm.cmd run build --prod "--progress=false" "--max-old-space-size=16384" "--max_old_space_size=16384""
2022-03-03T13:03:45.2243751Z npm ERR! code ELIFECYCLE**
2022-03-03T13:03:45.2244534Z
2022-03-03T13:03:45.2245410Z npm ERR! errno 1
2022-03-03T13:03:45.2245685Z > rentchief-app@0.1.0 build D:\a\1\s
2022-03-03T13:03:45.2246221Z > node scripts/build.js postbuild
2022-03-03T13:03:45.2246701Z npm ERR! rentchief-app@0.1.0 build: `node scripts/build.js postbuild`
2022-03-03T13:03:45.2246974Z
2022-03-03T13:03:45.2247274Z npm ERR! Exit status 1
2022-03-03T13:03:45.2247701Z Creating an optimized production build...
2022-03-03T13:03:45.2248224Z npm ERR!
2022-03-03T13:03:45.2248550Z Failed to compile.
2022-03-03T13:03:45.2250669Z npm ERR! Failed at the rentchief-app@0.1.0 build script.
2022-03-03T13:03:45.2250979Z
2022-03-03T13:03:45.2251494Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
**2022-03-03T13:03:45.2252009Z D:/a/1/s/src/components/atoms/FilterSidePanelBody/index.tsx
2022-03-03T13:03:45.2252308Z
2022-03-03T13:03:45.2253083Z TypeScript error: Type '{ change: any; cleared: any; focus: any; startDate: Date; endDate: Date; ref: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<Pick<RouteComponentProps<any, StaticContext, unknown>, never>, any, any>> & Readonly<...> & Readonly<...>'.
2022-03-03T13:03:45.2253960Z npm ERR! A complete log of this run can be found in:
2022-03-03T13:03:45.2254707Z Property 'change' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<Pick<RouteComponentProps<any, StaticContext, unknown>, never>, any, any>> & Readonly<...> & Readonly<...>'. TS2322
2022-03-03T13:03:45.2257239Z npm ERR! C:\npm\cache\_logs\2022-03-03T13_03_45_199Z-debug.log
2022-03-03T13:03:45.2257732Z
2022-03-03T13:03:45.2258516Z 177 | <div className={styles.dateRange}>
2022-03-03T13:03:45.2258917Z 178 | <DateRangePicker
2022-03-03T13:03:45.2259383Z > 179 | change={this.dateRangeChange.bind(this)}
2022-03-03T13:03:45.2259764Z | ^
2022-03-03T13:03:45.2260154Z 180 | cleared={this.dateRangeCleared.bind(this)}
2022-03-03T13:03:45.2260660Z 181 | focus={this.focusDateRange.bind(this)}
2022-03-03T13:03:45.2261086Z 182 | startDate={this.state.startDate}
2022-03-03T13:03:45.2261378Z**
2022-03-03T13:03:45.2261547Z
2022-03-03T13:03:45.3367847Z Found npm debug log, make sure the path matches with the one in npm's output: C:\npm\cache\_logs\2022-03-03T13_03_45_199Z-debug.log
2022-03-03T13:03:45.3368662Z 0 info it worked if it ends with ok
2022-03-03T13:03:45.3369021Z 1 verbose cli [
2022-03-03T13:03:45.3369429Z 1 verbose cli 'C:\\hostedtoolcache\\windows\\node\\14.18.1\\x64\\node.exe',
2022-03-03T13:03:45.3369987Z 1 verbose cli 'C:\\hostedtoolcache\\windows\\node\\14.18.1\\x64\\node_modules\\npm\\bin\\npm-cli.js',
2022-03-03T13:03:45.3370440Z 1 verbose cli 'run',
2022-03-03T13:03:45.3371063Z 1 verbose cli 'build',
2022-03-03T13:03:45.3371422Z 1 verbose cli '--prod',
2022-03-03T13:03:45.3372007Z 1 verbose cli '--progress=false',
2022-03-03T13:03:45.3372405Z 1 verbose cli '--max-old-space-size=16384',
2022-03-03T13:03:45.3372832Z 1 verbose cli '--max_old_space_size=16384'
2022-03-03T13:03:45.3373191Z 1 verbose cli ]
2022-03-03T13:03:45.3373531Z 2 info using npm@6.14.15
2022-03-03T13:03:45.3373882Z 3 info using node@v14.18.1
2022-03-03T13:03:45.3374283Z 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
2022-03-03T13:03:45.3374766Z 5 info lifecycle rentchief-app@0.1.0~prebuild: rentchief-app@0.1.0
2022-03-03T13:03:45.3410322Z 6 info lifecycle rentchief-app@0.1.0~build: rentchief-app@0.1.0
2022-03-03T13:03:45.3411252Z 7 verbose lifecycle rentchief-app@0.1.0~build: unsafe-perm in lifecycle true
2022-03-03T13:03:45.3432000Z 8 verbose lifecycle rentchief-app@0.1.0~build: PATH: C:\hostedtoolcache\windows\node\14.18.1\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\a\1\s\node_modules\.bin;C:\hostedtoolcache\windows\node\14.18.1\x64;C:\agents\2.200.2\externals\git\cmd;C:\agents\2.200.2\externals\git\mingw64\bin;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.7.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\tools\ghc-9.2.1\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.1.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\hostedtoolcache\windows\go\1.15.15\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.322-6\x64\bin;C:\npm\prefix;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.4\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Microsoft BizTalk Server\;C:\Program Files\LLVM\bin;C:\Users\VssAdministrator\.dotnet\tools;C:\Users\VssAdministrator\.cargo\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps
2022-03-03T13:03:45.3454945Z 9 verbose lifecycle rentchief-app@0.1.0~build: CWD: D:\a\1\s
2022-03-03T13:03:45.3460978Z 10 silly lifecycle rentchief-app@0.1.0~build: Args: [ '/d /s /c', 'node scripts/build.js postbuild' ]
2022-03-03T13:03:45.3461895Z 11 silly lifecycle rentchief-app@0.1.0~build: Returned: code: 1 signal: null
2022-03-03T13:03:45.3465399Z 12 info lifecycle rentchief-app@0.1.0~build: Failed to exec build script
2022-03-03T13:03:45.3466213Z 13 verbose stack Error: rentchief-app@0.1.0 build: `node scripts/build.js postbuild`
2022-03-03T13:03:45.3469765Z 13 verbose stack Exit status 1
2022-03-03T13:03:45.3470614Z 13 verbose stack at EventEmitter.<anonymous> (C:\hostedtoolcache\windows\node\14.18.1\x64\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
2022-03-03T13:03:45.3471351Z 13 verbose stack at EventEmitter.emit (events.js:400:28)
2022-03-03T13:03:45.3472044Z 13 verbose stack at ChildProcess.<anonymous> (C:\hostedtoolcache\windows\node\14.18.1\x64\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2022-03-03T13:03:45.3472738Z 13 verbose stack at ChildProcess.emit (events.js:400:28)
2022-03-03T13:03:45.3473273Z 13 verbose stack at maybeClose (internal/child_process.js:1058:16)
2022-03-03T13:03:45.3473837Z 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
2022-03-03T13:03:45.3474331Z 14 verbose pkgid rentchief-app@0.1.0
2022-03-03T13:03:45.3474711Z 15 verbose cwd D:\a\1\s
2022-03-03T13:03:45.3475066Z 16 verbose Windows_NT 10.0.17763
2022-03-03T13:03:45.3475804Z 17 verbose argv "C:\\hostedtoolcache\\windows\\node\\14.18.1\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\14.18.1\\x64\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "--prod" "--progress=false" "--max-old-space-size=16384" "--max_old_space_size=16384"
2022-03-03T13:03:45.3476496Z 18 verbose node v14.18.1
2022-03-03T13:03:45.3476853Z 19 verbose npm v6.14.15
2022-03-03T13:03:45.3477199Z 20 error code ELIFECYCLE
2022-03-03T13:03:45.3477528Z 21 error errno 1
2022-03-03T13:03:45.3477944Z 22 error rentchief-app@0.1.0 build: `node scripts/build.js postbuild`
2022-03-03T13:03:45.3478429Z 22 error Exit status 1
2022-03-03T13:03:45.3478838Z 23 error Failed at the rentchief-app@0.1.0 build script.
2022-03-03T13:03:45.3479352Z 23 error This is probably not a problem with npm. There is likely additional logging output above.
2022-03-03T13:03:45.3479819Z 24 verbose exit [ 1, true ]
2022-03-03T13:03:45.3480020Z
2022-03-03T13:03:45.3626536Z ##[error]Error: Npm failed with return code: 1
2022-03-03T13:03:45.3665518Z ##[section]Finishing: npm run build
Hope someone can help.
Thanks.
reactjs
devops
build-error
0 Answers
Your Answer