[{"data":1,"prerenderedAt":244},["ShallowReactive",2],{"DefaultLayouten":3,"language-blog-slug-abort-failing-nuxt-builds-on-netlify-i18n-slugs":134,"language-blog-slug-en-abort-failing-nuxt-builds-on-netlify":138},{"app":4,"menu":31,"footer":66},{"githubUrl":5,"youtubeUrl":6,"linkedinUrl":7,"phoneNumber":8,"emailAddress":9,"legal":10,"addresses":20},"https:\u002F\u002Fgithub.com\u002Fvoorhoede\u002F","https:\u002F\u002Fwww.youtube.com\u002Fchannel\u002FUCzHuhQVYFRixtQN2-swcuGg","https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Fde-voorhoede","+31 20 2610 954","post@voorhoede.nl",[11,14,17],{"title":12,"value":13},"KvK","56017235",{"title":15,"value":16},"BTW","NL851944620B01",{"title":18,"value":19},"IBAN","NL14TRIO0320142078",[21,26],{"address":22,"city":23,"googleMapsLink":24,"postalCode":25},"Koivistokade 70","Amsterdam","https:\u002F\u002Fwww.google.com\u002Fmaps\u002Fplace\u002FDe+Voorhoede+%7C+Front-end+Development\u002F@52.396847,4.8700823,17z\u002Fdata=!3m1!4b1!4m5!3m4!1s0x47c5e21d502d2d59:0xbf570944a96ebf45!8m2!3d52.347647!4d4.8502154","1013 BB",{"address":27,"city":28,"googleMapsLink":29,"postalCode":30},"Koornmarkt 22","Delft","https:\u002F\u002Fwww.google.nl\u002Fmaps\u002Fplace\u002FKoornmarkt+22,+2611+EG+Delft\u002F@52.0093477,4.3573054,17z\u002F","2611 EG",{"title":32,"callToActions":33,"links":39},"Site Menu",[34],{"id":35,"title":36,"link":37},"163140902","Contact",{"__typename":38},"ContactRecord",[40,46,51,56,61],{"id":41,"title":42,"link":43},"163140904","Impact",{"__typename":44,"slug":45},"PageRecord","impact",{"id":47,"title":48,"link":49},"163140905","Services",{"__typename":50},"ServiceOverviewRecord",{"id":52,"title":53,"link":54},"163140906","Cases",{"__typename":55},"CaseOverviewRecord",{"id":57,"title":58,"link":59},"163140908","About us",{"__typename":44,"slug":60},"about-us",{"id":62,"title":63,"link":64},"d6WdFJq2SOuc3dWtpibbXQ","Work at",{"__typename":44,"slug":65},"work-at",{"links":67,"copyrightTitle":93,"copyrightLabel":94,"copyrightLink":95,"privacyTitle":96,"privacyLabel":97,"privacyLink":98,"certificatesGrid":99},[68,71,74,77,82,85,88],{"id":69,"title":42,"link":70},"144185264",{"__typename":44,"slug":45},{"id":72,"title":48,"link":73},"144185265",{"__typename":50},{"id":75,"title":53,"link":76},"144185266",{"__typename":55},{"id":78,"title":79,"link":80},"144185267","Blog",{"__typename":81},"BlogPostOverviewRecord",{"id":83,"title":58,"link":84},"144185268",{"__typename":44,"slug":60},{"id":86,"title":36,"link":87},"144185269",{"__typename":38},{"id":89,"title":90,"link":91},"144185270","FAQ",{"__typename":44,"slug":92},"faq","Creative Commons licence and disclaimer","CC BY 4.0","https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002F","De Voorhoede privacy statement (pdf)","Privacy statement","https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1763455455-vh-isms-006-privacy-statement-de-voorhoede-en.pdf",[100,112,123],{"id":101,"image":102,"link":107},"Xq4bBfg_TZ6Fkjax9mkbLQ",{"url":103,"alt":104,"width":105,"height":106},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1687353463-b-corp-logo-black-rgb.png","B Corp logo",404,680,{"__typename":108,"id":109,"title":110,"url":111},"ExternalLinkRecord","fGW1ak8XQYaYDLkBSyncog","B Corp","https:\u002F\u002Fwww.bcorporation.net\u002Fen-us\u002Ffind-a-b-corp\u002Fcompany\u002Fde-voorhoede\u002F",{"id":113,"image":114,"link":119},"c5mCXRTiSraRIB25fw1p7Q",{"url":115,"alt":116,"width":117,"height":118},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1687353461-dda-boxlogo-black.png","Dutch Digital Agencies logo",627,480,{"__typename":108,"id":120,"title":121,"url":122},"P6Jh7B0cTv2cKyNEeKVWVQ","Dutch Digital Agencies","https:\u002F\u002Fdutchdigitalagencies.com\u002Fleden\u002Fde-voorhoede\u002F",{"id":124,"image":125,"link":129},"MT5SCyNxSTSr_v5eeATMZw",{"url":126,"alt":127,"width":128,"height":128},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1775730283-dnv.png","DNV logo",518,{"id":130,"title":131,"link":132},"BRtNB5HnT5i-7HkA8IYzBw","DIV",{"__typename":44,"slug":133},"impact\u002Fdigitale-producten-privacy-by-design",[135],{"locale":136,"value":137},"en","abort-failing-nuxt-builds-on-netlify",{"page":139},{"slug":137,"i18nSlugs":140,"social":142,"title":143,"subtitle":79,"isArchived":147,"headerIllustration":148,"date":149,"authors":150,"introTitle":159,"items":160,"pivots":231,"relatedBlogPosts":242,"tags":243,"onMountedScript":153,"onUnmountedScript":153},[141],{"locale":136,"value":137},{"title":143,"description":144,"image":145},"Abort failing Nuxt builds on Netlify","How to use `nuxt generate --fail-on-error` to prevent broken Nuxt builds from deploying on Netlify.",{"url":146},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1566230449-netlify-nuxt-generate-abort-on-error.jpg",false,null,"2019-08-20T02:00:00.000+02:00",[151],{"name":152,"lastName":153,"slug":154,"image":155},"Jasper","","jasper",{"url":156,"alt":148,"width":157,"height":158},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1683535518-jasper.jpg",1892,2523,"How to prevent broken Nuxt builds from deploying your site on Netlify?",[161,165,176,180,188,191,196,199,203,207,210,216,219,227],{"__typename":162,"id":163,"title":153,"body":164},"TextSectionRecord","1380297","\u003Cp>We love fast Nuxt builds on Netlify. But some builds ended up being impossibly fast. Turns out when a Nuxt build produces errors, the Netlify deploy still succeeds. 🤷&zwj;♂️&nbsp;In other words, broken Nuxt sites end up live in production. So how can we avoid this?\u003C\u002Fp>",{"__typename":166,"id":167,"image":168,"caption":173,"fullWidth":174,"captionPosition":175},"ImageRecord","176467399",{"url":169,"alt":170,"width":171,"height":172},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1566230397-netlify-nuxt-generate-broken-live.jpg","log showing Nuxt build errors",1328,828,"the problem: site is live even though errors occur during Nuxt build",true,"left",{"__typename":162,"id":177,"title":178,"body":179},"1380302"," Help failing","\u003Cp>Nuxt has no documentation online on how to abort builds with errors. Luckily there is something in the output of \u003Ccode>nuxt generate --help\u003C\u002Fcode> command:\u003C\u002Fp>",{"__typename":166,"id":181,"image":182,"caption":184,"fullWidth":174,"captionPosition":187},"176467400",{"url":183,"alt":184,"width":185,"height":186},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1566230651-nuxt-generate-help-shadowless.png","output of nuxt generate help command",1700,986,"right",{"__typename":162,"id":189,"title":153,"body":190},"1380306","\u003Cp>Turns out, all we need to do is add a \u003Ccode>--fail-on-error\u003C\u002Fcode> flag to our build command:\u003C\u002Fp>",{"__typename":192,"id":193,"language":194,"body":195},"CodeBlockRecord","1380686","bash","nuxt generate --fail-on-error",{"__typename":162,"id":197,"title":153,"body":198},"1380687","\u003Cp>That&rsquo;s it!\u003C\u002Fp>\u003Cblockquote class=\"blockquote--minimal\">\u003Cp>Do you want to become a Vue master? During our two day hands-on workshop we&rsquo;ll teach you everything you need to know to build large performant web apps with Vue. Vue is the SPA framework powering Nuxt, so a better understanding of Vue enables you to build better Nuxt projects.\u003C\u002Fp>\u003Cp>\u003Ca href=\"https:\u002F\u002Fwww.voorhoede.nl\u002Fvuemaster\">Join our Vue masterclass\u003C\u002Fa>\u003C\u002Fp>\u003C\u002Fblockquote>",{"__typename":162,"id":200,"title":201,"body":202},"1380688"," Failing successfully","\u003Cp>This is \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fnuxt\u002Fnuxt.js\u002Fblob\u002Fc6565c97c6ae65374d9a1ed330d4a21c7d7926b7\u002Fpackages\u002Fcli\u002Fsrc\u002Fcommands\u002Fgenerate.js#L79-L81\">what Nuxt does under the hood\u003C\u002Fa>:\u003C\u002Fp>",{"__typename":192,"id":204,"language":205,"body":206},"1380689","javascript","if (cmd.argv['fail-on-error'] && errors.length > 0) {\n  throw new Error('Error generating pages, exiting with non-zero code')\n}",{"__typename":162,"id":208,"title":153,"body":209},"1381660","\u003Cp>When Netlify receives a \"non-zero code\" it will fail the deploy:\u003C\u002Fp>",{"__typename":166,"id":211,"image":212,"caption":215,"fullWidth":174,"captionPosition":175},"176467401",{"url":146,"alt":170,"width":213,"height":214},1330,924,"problem solved: build throws errors and this prevents broken site going live",{"__typename":162,"id":217,"title":153,"body":218},"1381662","\u003Cp>This is exactly what we want. Because we only want to put our site live when a build is successful.\u003C\u002Fp>\n\u003Cp>And naturally this feeds back nicely into our development workflow on GitHub with ❌ and ✅ for failing and succeeding deploys:\u003C\u002Fp>",{"__typename":166,"id":220,"image":221,"caption":223,"fullWidth":147,"captionPosition":226},"1381663",{"url":222,"alt":223,"width":224,"height":225},"https:\u002F\u002Fwww.datocms-assets.com\u002F6524\u002F1566286050-github-pr-commits-with-statuses.jpg","GitHub PR commits with status indicators for failing and succeeding deploys",1354,136,"bottom",{"__typename":162,"id":228,"title":229,"body":230},"1381664","Failing by default?","\u003Cp>There may be scenarios where you want builds with errors to still deploy your site. However we think builds would be more predictable if they would fail on error by default. Maybe Nuxt will solve this in the future. For now, appending \u003Ccode>nuxt generate\u003C\u002Fcode> with \u003Ccode>--fail-on-error\u003C\u002Fcode> will fix our Nuxt builds on Netlify.\u003C\u002Fp>",[232],{"title":233,"body":234,"links":235,"mailchimpValue":153,"mailchimpName":153,"mailchimpId":153,"formType":153,"contactPerson":148},"Also in love with the web?","\u003Cp>For us, that’s about technology and user experience. Fast, available for all, enjoyable to use. And fun to build. This is how our team bands together, adhering to the same values, to make sure we achieve a solid result for clients both large and small. Does that fit you?\u003C\u002Fp>\n",[236],{"__typename":237,"id":238,"title":239,"link":240},"InternalLinkRecord","163140992","Join our team",{"__typename":44,"slug":241},"jobs",[],[],1776256144224]