netlify / next-runtime

The Next.js Runtime allows Next.js to run on Netlify with zero configuration
https://www.npmjs.com/package/@netlify/plugin-nextjs
640 stars 85 forks source link

SyntaxError - internal error during deploy within netlify/edge-functions #2570

Closed shuther closed 1 month ago

shuther commented 1 month ago

During build/deploy process using CLI, I am facing an internal error. I suspect there is an issue connected to an image but not sure how to find it? I did not get more context with DEBUG=* thank you for your help.

bun run ntl deploy --build 
❯ Version
  @netlify/build 29.53.0

❯ Flags
  accountId: 66c3082e9a4e0dc51faa6a41
  packagePath: apps/nextjs

❯ Current directory
  devP/web-main3-git

❯ Config file
  devP/web-main3-git/apps/nextjs/netlify.toml

❯ Context
  production

❯ Using Next.js Runtime - v5.6.0
---
(build.command completed in 2.3s)

Functions bundling                                            
────────────────────────────────────────────────────────────────

Packaging Functions from apps/nextjs/.netlify/functions-internal directory:
 - ___netlify-server-handler/___netlify-server-handler.mjs

(Functions bundling completed in 1.6s)

Edge Functions bundling                                       
────────────────────────────────────────────────────────────────

Packaging Edge Functions from apps/nextjs/.netlify/edge-functions directory:
 - ___netlify-edge-handler-src-middleware
Error compiling schema, function code: const schema16 = scope.schema[10];const formats0 = scope.formats[0];return function validate14(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.bundles === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "bundles"},message:"must have required property '"+"bundles"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.routes === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "routes"},message:"must have required property '"+"routes"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.bundler_version === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "bundler_version"},message:"must have required property '"+"bundler_version"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((((((key0 === "bundles") || (key0 === "routes")) || (key0 === "post_cache_routes")) || (key0 === "layers")) || (key0 === "import_map")) || (key0 === "bundler_version")) || (key0 === "function_config"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.bundles !== undefined){let data0 = data.bundles;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0<len0; i0++){let data1 = data0[i0];if(data1 && typeof data1 == "object" && !Array.isArray(data1)){if(data1.asset === undefined){const err4 = {instancePath:instancePath+"/bundles/" + i0,schemaPath:"#/properties/bundles/items/required",keyword:"required",params:{missingProperty: "asset"},message:"must have required property '"+"asset"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data1.format === undefined){const err5 = {instancePath:instancePath+"/bundles/" + i0,schemaPath:"#/properties/bundles/items/required",keyword:"required",params:{missingProperty: "format"},message:"must have required property '"+"format"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key1 in data1){if(!((key1 === "asset") || (key1 === "format"))){const err6 = {instancePath:instancePath+"/bundles/" + i0,schemaPath:"#/properties/bundles/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data1.asset !== undefined){if(typeof data1.asset !== "string"){const err7 = {instancePath:instancePath+"/bundles/" + i0+"/asset",schemaPath:"#/properties/bundles/items/properties/asset/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data1.format !== undefined){let data3 = data1.format;if(typeof data3 !== "string"){const err8 = {instancePath:instancePath+"/bundles/" + i0+"/format",schemaPath:"#/properties/bundles/items/properties/format/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(!((data3 === "eszip2") || (data3 === "js"))){const err9 = {instancePath:instancePath+"/bundles/" + i0+"/format",schemaPath:"#/properties/bundles/items/properties/format/enum",keyword:"enum",params:{allowedValues: schema16.properties.bundles.items.properties.format.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}else {const err10 = {instancePath:instancePath+"/bundles/" + i0,schemaPath:"#/properties/bundles/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath:instancePath+"/bundles",schemaPath:"#/properties/bundles/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.routes !== undefined){let data4 = data.routes;if(Array.isArray(data4)){const len1 = data4.length;for(let i1=0; i1<len1; i1++){let data5 = data4[i1];if(data5 && typeof data5 == "object" && !Array.isArray(data5)){if(data5.function === undefined){const err12 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: "function"},message:"must have required property '"+"function"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data5.pattern === undefined){const err13 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: "pattern"},message:"must have required property '"+"pattern"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}for(const key2 in data5){if(!(((((((key2 === "name") || (key2 === "function")) || (key2 === "pattern")) || (key2 === "excluded_patterns")) || (key2 === "generator")) || (key2 === "path")) || (key2 === "methods"))){const err14 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data5.name !== undefined){if(typeof data5.name !== "string"){const err15 = {instancePath:instancePath+"/routes/" + i1+"/name",schemaPath:"#/properties/routes/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data5.function !== undefined){if(typeof data5.function !== "string"){const err16 = {instancePath:instancePath+"/routes/" + i1+"/function",schemaPath:"#/properties/routes/items/properties/function/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data5.pattern !== undefined){let data8 = data5.pattern;if(typeof data8 === "string"){if(!(formats0.validate(data8))){const err17 = {instancePath:instancePath+"/routes/" + i1+"/pattern",schemaPath:"#/properties/routes/items/properties/pattern/format",keyword:"format",params:{format: "regexPattern"},message:"must match format \""+"regexPattern"+"\""};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+"/routes/" + i1+"/pattern",schemaPath:"#/properties/routes/items/properties/pattern/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(errors > 0){for(const err19 of vErrors){if((((({"str":"err19"}.keyword !== "errorMessage") && (!{"str":"err19"}.emUsed)) && (({"str":"err19"}.instancePath === instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}) || (({"str":"err19"}.instancePath.indexOf(instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}) === 0) && ({"str":"err19"}.instancePath[instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}.length] === "/")))) && ({"str":"err19"}.schemaPath.indexOf("#/properties/routes/items/properties/pattern") === 0)) && ({"str":"err19"}.schemaPath["#/properties/routes/items/properties/pattern".length] === "/")){{"str":"emErrs0"}.push({"str":"err19"});{"str":"err19"}.emUsed = true;}}if({"str":"emErrs0"}.length){if(vErrors === null){vErrors = [{"str":"err20"}];}else {vErrors.push({"str":"err20"});}errors++;}const emErrs1 = [];for(const err21 of vErrors){if(!{"str":"err21"}.emUsed){{"str":"emErrs1"}.push({"str":"err21"});}}vErrors = emErrs1;errors = {"str":"emErrs1"}.length;}}if(data5.excluded_patterns !== undefined){let data9 = data5.excluded_patterns;if(Array.isArray(data9)){const len2 = data9.length;for(let i2=0; i2<len2; i2++){let data10 = data9[i2];if(typeof data10 === "string"){if(!(formats0.validate(data10))){const err22 = {instancePath:instancePath+"/routes/" + i1+"/excluded_patterns/" + i2,schemaPath:"#/properties/routes/items/properties/excluded_patterns/items/format",keyword:"format",params:{format: "regexPattern"},message:"must match format \""+"regexPattern"+"\""};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/routes/" + i1+"/excluded_patterns/" + i2,schemaPath:"#/properties/routes/items/properties/excluded_patterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(errors > 0){for(const err24 of vErrors){if((((({"str":"err24"}.keyword !== "errorMessage") && (!{"str":"err24"}.emUsed)) && (({"str":"err24"}.instancePath === instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/excluded_patterns/\" + ",{"str":"i2"},""]}) || (({"str":"err24"}.instancePath.indexOf(instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/excluded_patterns/\" + ",{"str":"i2"},""]}) === 0) && ({"str":"err24"}.instancePath[instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/excluded_patterns/\" + ",{"str":"i2"},""]}.length] === "/")))) && ({"str":"err24"}.schemaPath.indexOf("#/properties/routes/items/properties/excluded_patterns/items") === 0)) && ({"str":"err24"}.schemaPath["#/properties/routes/items/properties/excluded_patterns/items".length] === "/")){{"str":"emErrs2"}.push({"str":"err24"});{"str":"err24"}.emUsed = true;}}if({"str":"emErrs2"}.length){if(vErrors === null){vErrors = [{"str":"err25"}];}else {vErrors.push({"str":"err25"});}errors++;}const emErrs3 = [];for(const err26 of vErrors){if(!{"str":"err26"}.emUsed){{"str":"emErrs3"}.push({"str":"err26"});}}vErrors = emErrs3;errors = {"str":"emErrs3"}.length;}}}else {const err27 = {instancePath:instancePath+"/routes/" + i1+"/excluded_patterns",schemaPath:"#/properties/routes/items/properties/excluded_patterns/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data5.generator !== undefined){if(typeof data5.generator !== "string"){const err28 = {instancePath:instancePath+"/routes/" + i1+"/generator",schemaPath:"#/properties/routes/items/properties/generator/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data5.path !== undefined){if(typeof data5.path !== "string"){const err29 = {instancePath:instancePath+"/routes/" + i1+"/path",schemaPath:"#/properties/routes/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data5.methods !== undefined){let data13 = data5.methods;if(Array.isArray(data13)){const len3 = data13.length;for(let i3=0; i3<len3; i3++){let data14 = data13[i3];if(typeof data14 !== "string"){const err30 = {instancePath:instancePath+"/routes/" + i1+"/methods/" + i3,schemaPath:"#/properties/routes/items/properties/methods/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(!((((((data14 === "GET") || (data14 === "POST")) || (data14 === "PUT")) || (data14 === "PATCH")) || (data14 === "DELETE")) || (data14 === "OPTIONS"))){const err31 = {instancePath:instancePath+"/routes/" + i1+"/methods/" + i3,schemaPath:"#/properties/routes/items/properties/methods/items/enum",keyword:"enum",params:{allowedValues: schema16.properties.routes.items.properties.methods.items.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}}else {const err32 = {instancePath:instancePath+"/routes/" + i1+"/methods",schemaPath:"#/properties/routes/items/properties/methods/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}}else {const err33 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}}else {const err34 = {instancePath:instancePath+"/routes",schemaPath:"#/properties/routes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data.post_cache_routes !== undefined){let data15 = data.post_cache_routes;if(Array.isArray(data15)){const len4 = data15.length;for(let i4=0; i4<len4; i4++){let data16 = data15[i4];if(data16 && typeof data16 == "object" && !Array.isArray(data16)){if(data16.function === undefined){const err35 = {instancePath:instancePath+"/post_cache_routes/" + i4,schemaPath:"#/properties/post_cache_routes/items/required",keyword:"required",params:{missingProperty: "function"},message:"must have required property '"+"function"+"'"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data16.pattern === undefined){const err36 = {instancePath:instancePath+"/post_cache_routes/" + i4,schemaPath:"#/properties/post_cache_routes/items/required",keyword:"required",params:{missingProperty: "pattern"},message:"must have required property '"+"pattern"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key3 in data16){if(!(((((((key3 === "name") || (key3 === "function")) || (key3 === "pattern")) || (key3 === "excluded_patterns")) || (key3 === "generator")) || (key3 === "path")) || (key3 === "methods"))){const err37 = {instancePath:instancePath+"/post_cache_routes/" + i4,schemaPath:"#/properties/post_cache_routes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data16.name !== undefined){if(typeof data16.name !== "string"){const err38 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/name",schemaPath:"#/properties/post_cache_routes/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data16.function !== undefined){if(typeof data16.function !== "string"){const err39 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/function",schemaPath:"#/properties/post_cache_routes/items/properties/function/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data16.pattern !== undefined){let data19 = data16.pattern;if(typeof data19 === "string"){if(!(formats0.validate(data19))){const err40 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/pattern",schemaPath:"#/properties/post_cache_routes/items/properties/pattern/format",keyword:"format",params:{format: "regexPattern"},message:"must match format \""+"regexPattern"+"\""};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/pattern",schemaPath:"#/properties/post_cache_routes/items/properties/pattern/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(errors > 0){for(const err42 of vErrors){if((((({"str":"err42"}.keyword !== "errorMessage") && (!{"str":"err42"}.emUsed)) && (({"str":"err42"}.instancePath === instancePath+{"_items":["\"/post_cache_routes/\" + ",{"str":"i4"},"","+","\"/pattern\""]}) || (({"str":"err42"}.instancePath.indexOf(instancePath+{"_items":["\"/post_cache_routes/\" + ",{"str":"i4"},"","+","\"/pattern\""]}) === 0) && ({"str":"err42"}.instancePath[instancePath+{"_items":["\"/post_cache_routes/\" + ",{"str":"i4"},"","+","\"/pattern\""]}.length] === "/")))) && ({"str":"err42"}.schemaPath.indexOf("#/properties/post_cache_routes/items/properties/pattern") === 0)) && ({"str":"err42"}.schemaPath["#/properties/post_cache_routes/items/properties/pattern".length] === "/")){{"str":"emErrs4"}.push({"str":"err42"});{"str":"err42"}.emUsed = true;}}if({"str":"emErrs4"}.length){if(vErrors === null){vErrors = [{"str":"err43"}];}else {vErrors.push({"str":"err43"});}errors++;}const emErrs5 = [];for(const err44 of vErrors){if(!{"str":"err44"}.emUsed){{"str":"emErrs5"}.push({"str":"err44"});}}vErrors = emErrs5;errors = {"str":"emErrs5"}.length;}}if(data16.excluded_patterns !== undefined){let data20 = data16.excluded_patterns;if(Array.isArray(data20)){const len5 = data20.length;for(let i5=0; i5<len5; i5++){let data21 = data20[i5];if(typeof data21 === "string"){if(!(formats0.validate(data21))){const err45 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/excluded_patterns/" + i5,schemaPath:"#/properties/post_cache_routes/items/properties/excluded_patterns/items/format",keyword:"format",params:{format: "regexPattern"},message:"must match format \""+"regexPattern"+"\""};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}else {const err46 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/excluded_patterns/" + i5,schemaPath:"#/properties/post_cache_routes/items/properties/excluded_patterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(errors > 0){for(const err47 of vErrors){if((((({"str":"err47"}.keyword !== "errorMessage") && (!{"str":"err47"}.emUsed)) && (({"str":"err47"}.instancePath === instancePath+{"_items":["\"/post_cache_routes/\" + ",{"str":"i4"},"","+","\"/excluded_patterns/\" + ",{"str":"i5"},""]}) || (({"str":"err47"}.instancePath.indexOf(instancePath+{"_items":["\"/post_cache_routes/\" + ",{"str":"i4"},"","+","\"/excluded_patterns/\" + ",{"str":"i5"},""]}) === 0) && ({"str":"err47"}.instancePath[instancePath+{"_items":["\"/post_cache_routes/\" + ",{"str":"i4"},"","+","\"/excluded_patterns/\" + ",{"str":"i5"},""]}.length] === "/")))) && ({"str":"err47"}.schemaPath.indexOf("#/properties/post_cache_routes/items/properties/excluded_patterns/items") === 0)) && ({"str":"err47"}.schemaPath["#/properties/post_cache_routes/items/properties/excluded_patterns/items".length] === "/")){{"str":"emErrs6"}.push({"str":"err47"});{"str":"err47"}.emUsed = true;}}if({"str":"emErrs6"}.length){if(vErrors === null){vErrors = [{"str":"err48"}];}else {vErrors.push({"str":"err48"});}errors++;}const emErrs7 = [];for(const err49 of vErrors){if(!{"str":"err49"}.emUsed){{"str":"emErrs7"}.push({"str":"err49"});}}vErrors = emErrs7;errors = {"str":"emErrs7"}.length;}}}else {const err50 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/excluded_patterns",schemaPath:"#/properties/post_cache_routes/items/properties/excluded_patterns/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data16.generator !== undefined){if(typeof data16.generator !== "string"){const err51 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/generator",schemaPath:"#/properties/post_cache_routes/items/properties/generator/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data16.path !== undefined){if(typeof data16.path !== "string"){const err52 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/path",schemaPath:"#/properties/post_cache_routes/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}if(data16.methods !== undefined){let data24 = data16.methods;if(Array.isArray(data24)){const len6 = data24.length;for(let i6=0; i6<len6; i6++){let data25 = data24[i6];if(typeof data25 !== "string"){const err53 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/methods/" + i6,schemaPath:"#/properties/post_cache_routes/items/properties/methods/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}if(!((((((data25 === "GET") || (data25 === "POST")) || (data25 === "PUT")) || (data25 === "PATCH")) || (data25 === "DELETE")) || (data25 === "OPTIONS"))){const err54 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/methods/" + i6,schemaPath:"#/properties/post_cache_routes/items/properties/methods/items/enum",keyword:"enum",params:{allowedValues: schema16.properties.post_cache_routes.items.properties.methods.items.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}}else {const err55 = {instancePath:instancePath+"/post_cache_routes/" + i4+"/methods",schemaPath:"#/properties/post_cache_routes/items/properties/methods/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/post_cache_routes/" + i4,schemaPath:"#/properties/post_cache_routes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath:instancePath+"/post_cache_routes",schemaPath:"#/properties/post_cache_routes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data.layers !== undefined){let data26 = data.layers;if(Array.isArray(data26)){const len7 = data26.length;for(let i7=0; i7<len7; i7++){let data27 = data26[i7];if(data27 && typeof data27 == "object" && !Array.isArray(data27)){if(data27.flag === undefined){const err58 = {instancePath:instancePath+"/layers/" + i7,schemaPath:"#/properties/layers/items/required",keyword:"required",params:{missingProperty: "flag"},message:"must have required property '"+"flag"+"'"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(data27.name === undefined){const err59 = {instancePath:instancePath+"/layers/" + i7,schemaPath:"#/properties/layers/items/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}for(const key4 in data27){if(!(((key4 === "flag") || (key4 === "name")) || (key4 === "local"))){const err60 = {instancePath:instancePath+"/layers/" + i7,schemaPath:"#/properties/layers/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data27.flag !== undefined){if(typeof data27.flag !== "string"){const err61 = {instancePath:instancePath+"/layers/" + i7+"/flag",schemaPath:"#/properties/layers/items/properties/flag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data27.name !== undefined){if(typeof data27.name !== "string"){const err62 = {instancePath:instancePath+"/layers/" + i7+"/name",schemaPath:"#/properties/layers/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data27.local !== undefined){if(typeof data27.local !== "string"){const err63 = {instancePath:instancePath+"/layers/" + i7+"/local",schemaPath:"#/properties/layers/items/properties/local/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}}else {const err64 = {instancePath:instancePath+"/layers/" + i7,schemaPath:"#/properties/layers/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}}else {const err65 = {instancePath:instancePath+"/layers",schemaPath:"#/properties/layers/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data.import_map !== undefined){if(typeof data.import_map !== "string"){const err66 = {instancePath:instancePath+"/import_map",schemaPath:"#/properties/import_map/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}if(data.bundler_version !== undefined){if(typeof data.bundler_version !== "string"){const err67 = {instancePath:instancePath+"/bundler_version",schemaPath:"#/properties/bundler_version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data.function_config !== undefined){let data33 = data.function_config;if(data33 && typeof data33 == "object" && !Array.isArray(data33)){for(const key5 in data33){let data34 = data33[key5];if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(data34.excluded_patterns !== undefined){let data35 = data34.excluded_patterns;if(Array.isArray(data35)){const len8 = data35.length;for(let i8=0; i8<len8; i8++){let data36 = data35[i8];if(typeof data36 === "string"){if(!(formats0.validate(data36))){const err68 = {instancePath:instancePath+"/function_config/" + key5.replace(/~/g, "~0").replace(/\//g, "~1")+"/excluded_patterns/" + i8,schemaPath:"#/properties/function_config/additionalProperties/properties/excluded_patterns/items/format",keyword:"format",params:{format: "regexPattern"},message:"must match format \""+"regexPattern"+"\""};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}else {const err69 = {instancePath:instancePath+"/function_config/" + key5.replace(/~/g, "~0").replace(/\//g, "~1")+"/excluded_patterns/" + i8,schemaPath:"#/properties/function_config/additionalProperties/properties/excluded_patterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}if(errors > 0){for(const err70 of vErrors){if((((({"str":"err70"}.keyword !== "errorMessage") && (!{"str":"err70"}.emUsed)) && (({"str":"err70"}.instancePath === instancePath+{"_items":["\"/function_config/\" + ",{"str":"key5"},".replace(/~/g, \"~0\").replace(/\\//g, \"~1\")","+","\"/excluded_patterns/\" + ",{"str":"i8"},""]}) || (({"str":"err70"}.instancePath.indexOf(instancePath+{"_items":["\"/function_config/\" + ",{"str":"key5"},".replace(/~/g, \"~0\").replace(/\\//g, \"~1\")","+","\"/excluded_patterns/\" + ",{"str":"i8"},""]}) === 0) && ({"str":"err70"}.instancePath[instancePath+{"_items":["\"/function_config/\" + ",{"str":"key5"},".replace(/~/g, \"~0\").replace(/\\//g, \"~1\")","+","\"/excluded_patterns/\" + ",{"str":"i8"},""]}.length] === "/")))) && ({"str":"err70"}.schemaPath.indexOf("#/properties/function_config/additionalProperties/properties/excluded_patterns/items") === 0)) && ({"str":"err70"}.schemaPath["#/properties/function_config/additionalProperties/properties/excluded_patterns/items".length] === "/")){{"str":"emErrs8"}.push({"str":"err70"});{"str":"err70"}.emUsed = true;}}if({"str":"emErrs8"}.length){if(vErrors === null){vErrors = [{"str":"err71"}];}else {vErrors.push({"str":"err71"});}errors++;}const emErrs9 = [];for(const err72 of vErrors){if(!{"str":"err72"}.emUsed){{"str":"emErrs9"}.push({"str":"err72"});}}vErrors = emErrs9;errors = {"str":"emErrs9"}.length;}}}else {const err73 = {instancePath:instancePath+"/function_config/" + key5.replace(/~/g, "~0").replace(/\//g, "~1")+"/excluded_patterns",schemaPath:"#/properties/function_config/additionalProperties/properties/excluded_patterns/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}if(data34.on_error !== undefined){if(typeof data34.on_error !== "string"){const err74 = {instancePath:instancePath+"/function_config/" + key5.replace(/~/g, "~0").replace(/\//g, "~1")+"/on_error",schemaPath:"#/properties/function_config/additionalProperties/properties/on_error/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}}else {const err75 = {instancePath:instancePath+"/function_config/" + key5.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/function_config/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/function_config",schemaPath:"#/properties/function_config/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}validate14.errors = vErrors;return errors === 0;}

Internal error during "Edge Functions bundling"               
────────────────────────────────────────────────────────────────

  Error message
  SyntaxError: Unexpected token ':'

  Error location
  During Edge Functions bundling
      at new Function (<anonymous>)
      at Ajv.compileSchema (devP/web-main3-git/node_modules/@netlify/edge-bundler/node_modules/ajv/dist/compile/index.js:89:30)
      at Ajv._compileSchemaEnv (devP/web-main3-git/node_modules/@netlify/edge-bundler/node_modules/ajv/dist/core.js:473:37)
      at Ajv.compile (devP/web-main3-git/node_modules/@netlify/edge-bundler/node_modules/ajv/dist/core.js:160:38)
      at initializeValidator (file://devP/web-main3-git/node_modules/@netlify/edge-bundler/dist/node/validation/manifest/index.js:17:33)
      at validateManifest (file://devP/web-main3-git/node_modules/@netlify/edge-bundler/dist/node/validation/manifest/index.js:24:22)
      at validateEdgeFunctionsManifest (file://devP/web-main3-git/node_modules/@netlify/build/lib/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.js:5:9)
      at coreStep (file://devP/web-main3-git/node_modules/@netlify/build/lib/plugins_core/edge_functions/index.js:73:15)
      at async fireCoreStep (file://devP/web-main3-git/node_modules/@netlify/build/lib/steps/core_step.js:11:98)
      at async tFireStep (file://devP/web-main3-git/node_modules/@netlify/build/lib/time/main.js:18:63)

  Resolved config
  build:
    command: bun run build
    commandOrigin: config
    publish: devP/web-main3-git/apps/nextjs/.next
    publishOrigin: config
  plugins:
    - inputs: {}
      origin: ui
      package: '@netlify/plugin-nextjs'
  redirects:
    - from: /_next/image
      query:
        q: ':quality'
        url: ':url'
        w: ':width'
      status: 200
      to: /.netlify/images?url=:url&w=:width&q=:quality
    - from: /_ipx/*
      query:
        q: ':quality'
        url: ':url'
        w: ':width'
      status: 200
      to: /.netlify/images?url=:url&w=:width&q=:quality
  redirectsOrigin: inline
error: script "ntl" exited with code 4
pieh commented 1 month ago

netlify CLI doesn't support running in bun (it might work or not, but we don't validate if it does) - can you try using node here? If the error can be reproduced with node - can you share node and netlify CLI versions that this happend on?

Side note: This error doesn't seem related to Next Runtime / your site/app specifically, as it fails on this line https://github.com/netlify/build/blob/d5ef4079308264d6175731fd9d3ff1c2ae1e1200/packages/edge-bundler/node/validation/manifest/index.ts#L26 (part of netlify CLI) which initialize a schema validator before even passing things that Next Runtime produced for your site/app through it.

shuther commented 1 month ago

so it works without bun :) thank you for the hint.