{"id":198,"date":"2024-06-15T04:36:41","date_gmt":"2024-06-14T20:36:41","guid":{"rendered":"https:\/\/aabirtech.com\/shiblenomanblog\/?p=198"},"modified":"2024-08-10T09:08:58","modified_gmt":"2024-08-10T01:08:58","slug":"fixing-azure-static-app-error-while-deploying-next-js","status":"publish","type":"post","link":"https:\/\/aabirtech.com\/shiblenomanblog\/2024\/06\/15\/fixing-azure-static-app-error-while-deploying-next-js\/","title":{"rendered":"Fixing Azure Static App Error while Deploying Next.js"},"content":{"rendered":"\n<p>If you encounter the following error while deploying your Next.js app to Azure Static App via a GitHub CD\/CI pipeline:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>You are using Node.js 16.20.2. For Next.js, Node.js version &gt;= v18.17.0 is required.\n\n\n---End of Oryx build logs---\nOryx has failed to build the solution.<\/code><\/pre>\n\n\n\n<p>Don&#8217;t worry, it&#8217;s a quick fix! You just need to add one line to your <code>package.json<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"engines\": {\n    \"node\": \"&gt;=18.0.0\"\n}<\/code><\/pre>\n\n\n\n<p>After adding this line, your <code>package.json<\/code> file should look something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"start\": \"next start\"\n  },\n  \"dependencies\": {\n    \"next\": \"latest\",\n    \"react\": \"18.2.0\",\n    \"react-dom\": \"18.2.0\",\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n<\/code><\/pre>\n\n\n\n<p>Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you encounter the following error while deploying your Next.js app to Azure Static App via a GitHub CD\/CI pipeline: Don&#8217;t worry, it&#8217;s a quick fix! You just need to add one line to your package.json file: After adding this line, your package.json file should look something like this: Happy coding \ud83d\ude42<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17,24],"tags":[],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-azure","category-nextjs"],"acf":[],"_links":{"self":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":2,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":205,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/198\/revisions\/205"}],"wp:attachment":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}