I'm trying to deploy my Next.js app to Heroku however, my pipeline fails due to the following error: File name is too long (cannot be split); not dumpedtar. Does anyone have any idea on how to fix this? See below the error and my pipeline configuration.
<span>image</span><span>:</span> <span>node:10.15.3</span><br><span>pipelines</span><span>:</span> <span>default</span><span>:</span> <span>-</span> <span>step</span><span>:</span> <span>name</span><span>:</span> <span>Install dependencies</span> <span>caches</span><span>:</span> <span>-</span> <span>node</span> <span>script</span><span>:</span> <span>-</span> <span>npm install</span> <span>-</span> <span>step</span><span>:</span> <span>name</span><span>:</span> <span>Build app</span> <span>caches</span><span>:</span> <span>-</span> <span>node</span> <span>script</span><span>:</span> <span>-</span> <span>npm run build</span> <span>artifacts</span><span>:</span> <span># defining the artifacts to be passed to each future step.</span> <span>-</span> <span>.next/**</span> <span>-</span> <span>step</span><span>:</span> <span>name</span><span>:</span> <span>Create artifact</span> <span>script</span><span>:</span> <span>-</span> <span>git archive --format=tar master -o app.tar</span> <span>-</span> <span>tar --append --file=app.tar .next</span> <span>-</span> <span>gzip app.tar</span> <span>artifacts</span><span>:</span> <span>-</span> <span>app.tar.gz</span> <span>-</span> <span>step</span><span>:</span> <span>name</span><span>:</span> <span>Deploy to staging</span> <span>deployment</span><span>:</span> <span>staging</span> <span>trigger</span><span>:</span> <span>manual</span> <span>script</span><span>:</span> <span>-</span> <span>pipe</span><span>:</span> <span>atlassian/heroku-deploy:0.1.1</span> <span>variables</span><span>:</span> <span>HEROKU_API_KEY</span><span>:</span> <span>$HEROKU_API_KEY</span> <span>HEROKU_APP_NAME</span><span>:</span> <span>$HEROKU_APP_NAME</span> <span>ZIP_FILE</span><span>:</span> <span>app.tar.gz</span> <span>-</span> <span>step</span><span>:</span> <span>name</span><span>:</span> <span>Deploy to production</span> <span>deployment</span><span>:</span> <span>production</span> <span>trigger</span><span>:</span> <span>manual</span> <span>script</span><span>:</span> <span>-</span> <span>pipe</span><span>:</span> <span>atlassian/heroku-deploy:1.2.1</span> <span>variables</span><span>:</span> <span>HEROKU_API_KEY</span><span>:</span> <span>$HEROKU_API_KEY</span> <span>HEROKU_APP_NAME</span><span>:</span> <span>$HEROKU_APP_NAME</span> <span>ZIP_FILE</span><span>:</span> <span>app.tar.gz</span>
<span>tar: .next/cache/next-minifier/content-v2/sha512/60/fe/c4e16bbd2364ecd521508b6dc3ef28320e44b6092130d0a1ca897a173934219d059a3b72ed13d2dd0c8f03d23c2c4e244a026641dc45b41a533a1f81473b: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/1a/7c/03d029df439cd0b5bf03a7f6dd6b8346f6656a7dbf10dae8360136711ff824f87fa11e21b6495c2fb52882860b0c5dbc59088e76b7cf5e2dc9170ae502db: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/58/5f/0dbcf33982ee508fbf5413a7711165edd8bc7dffb8d9c35d7d2fb4979b8dddf6041148382aeebc2b1a718e4b84c6c87894308f6668403e801e022ca4a23a: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/0a/43/13f5b587a2c82e299d1ec7002f6fc079de532dd19501319a844800acb5363bff41005828cddd1de75c009b35ef90b7349d28741b90ddd20b4633affaec47: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/eb/08/635d356dab45a9c0df4bf3be7b3df7f1c2f6556b588bb1d62fec2b8c2f6cb5a36b8a2e1276aea8bfcca518bdc89dda9a3f2336d1a91bfdc8d15632871e74: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/df/e0/f2b05d200363ff0059064ad4ade84407d742a62bade6fb5c91c908dcd2b3bbcfb10c7dd43090c1cd9a6e46e6883033c6aac8f32ac513fd2e12011b9715fd: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/68/39/31be9eab6e0681151fec86e1f1f904cd2a0f1d81b548639154a002ab78c42399d144b377fa73fd36e685902bc59d3a7d5a733f117fb0fecf9add806888d2: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/7d/29/f460f1f5f435b240080ab6790e3732eb3ff0b54bb3600e7b2db925bd7daf597515ca89916f69a2b8f780b42edbe9ceab730eeeff240381d2c21fbce9a13e: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/1e/53/acf33d06a622ab480845f21e1fd5493b5ed49bed7a8a40ee4d3e75b41f7f1a7e4818f65c758ad420db8509cae8ed19d4dc40035080e83c34ddee491cf6c3: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/94/91/8f93e5555ed76b930383d8e14b5f01d10a720587f046d8aff4ab127890aa606d556a99a2b5cfc1d4beef242abff12fe442779503653ca88a71f07dc94829: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/90/9b/2cab871732fcb31a9973b8fa10a5d0a9b779223a0227c6b59978bf70179bc0491be7d5a10f23aed91e8a1897de36c36087942705d90ed5c640c34b321eba: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/e3/69/0df641b472ce512581deb81a57be1dd4c6fdce9979c7e93f2690c079a15edcb2a9ee0e207fcfe3064172c34a6e4264902e18c33a24f1469d1255e2e900e9: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/5c/1c/1a5735ba02220710c3223e74e569c4d00dc24f755e5b12968eaa17321aec352d42e62f771608a11e2b5d66daae53abb1f72a465cd098b9dedefcd0b9b538: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/76/66/55df51a8ac619fda05a04adbf4f7fcd240c91b391d52dca35b167db7323cfabae530691c661050a01419888203f3447fcd288c7d0defb39e8f9b99a0782d: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/0e/f6/5ef5c8234f17152edabfaa70b3d145d4e59c060507fe67899c58b4830e3dff39a1917349f0c9442c070ad7163b986e92b911a2bd522b743d4de09c7d133c: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/20/aa/9038bc73069a5a6909c221e389a1fcfe699ce46e8975fb2fa25126a14d8f431162626e54f803b78f8cb01315e7710215dfe9ef0e0bd13889939b588aeb7e: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/f4/9e/ee53fbba39f4cf5c7d2012e4aa2bdaed807c1e8a4f07ff58b4d008d90353125900d263d44ef45167b1cead12689c29093e7f719bf7f65b99946c2daeae2b: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/f6/0e/94a5a37c7dbf2bcc4574ba953cd5fa1b8512626e1a246a4c9b1c4171564465cbf9177bc9cbb1f49108df870563a88538ce8b66c7bca8f1fc2b41a1048a95: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/d6/5b/2e45871410882c7b0a852c548c8131acbd29e0daca53563eda55acde57b937212c34075b8a0b448aa53d99c932ec005325089cd6a925cf745f657f9542da: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/4b/04/b12948468c43a13954203138610e28df97e0422ed8db1cbf4d9b42ca5854a6e90a85d3f077b812f162daf22df2e28f9df528311bd9271bdaae25066c5046: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/2a/ce/4e9bddb6312fa474160fbb9f1ac797a61c123243622a3df9e9ee4aee769202f5a1d2d5477ca75b303174387eaebe9a3fe742a8bb762d005cd0cd54d668ba: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/2a/b9/adfea0a483a89bfc62160ea87593541b377ca622be8b73da657da9248c53d16a713e4068ad8868f1ac58166a0b65717262c5c4603c63310ecc54fbe6e65b: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/81/2a/8404369075491b1f2b0e6f5ce4e68acc615dc4b6b2f1d01c39c44ec3a0a6bb2800b1748c16a1874c92f63d42e76dd1581e8ab9f2590fa80a394ca049beb0: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/4c/26/1b7a77c2c56fdc8bff3c14436243b8c98d15275d14c35a30285990416f879238a5d55c38bf55efa0ee902fcf86137e893bb0e1312ba06da8dc9a5be704a9: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/5b/52/d7571b941e876a7dd9184f94392e27d0cd0156af25798ca83335027de6d2c2d0925425078a1cb489ff2b6e283ae5c571dbc26506e3a2fbbb3acba76bfc96: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/5b/6d/67974e36e543c25d489e37788e3d5c16ec854de3df806d1947bf90dd78707eaf5f55d9add9e8e40111bdd88429b18eabd285371540798384836926d49a43: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/f0/4d/22738decf9dd734fc0386b428d9426d95eb173485c519a2b493830e975cf4036551f12c4e633c1521c64e7ee79b0dec579459d0eb28563542bd4f04b1815: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/b0/c8/a8ae13a0ddcc99a966d894f9b7bccbaf055fb91adf5032d5cbc6c435402e16fa13a0217204598ff436698649880a64940be27bac864c243d38eb9a66e60d: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/b0/ad/d19f428638d6bd358079f98f192a2c8bf8dae75d2958c4fb696a592a267bada2ba80e305b433b190d367156ab564d9f638756d6db967ee5d267aaeb5f3e4: file name is too long (cannot be split); not dumped</span><span>tar: .next/cache/next-minifier/content-v2/sha512/00/5f/8b494e2d0c0c1916882a2ac64bcd6fc262ed1160c781ab25a4826af8201693c885c0b74a751bfe036de2734a51de1d94963829b6d59f8873be261f39374a: file name is too long (cannot be split); not dumped</span><span>tar: Exiting with failure status due to previous errors</span><span>+ tar --append --file=app.tar .next</span>