Syntax Error during deploy --build command step bundling EdgeFunctions

Hi, i am experiencing an issue using netlify-cli to build and deploy a site with some netlify functions.

Locally using netlify dev command everything is working fine. when I run netlify deploy --build --prod --debug -m "message" command an issue occurred at step 5. Edge Functions bundling

A consideration, my functions are standard netlify functions and not edge, and they are bundled successfully at step 4; so I think that at this step the bundling is done on kind of standard provided functions.

The issue seems releted to the validation of the schema of the manifest (line 1290 of the logs)

Hope that you can help. Thanks in advance.

Contex:
CICD - GitHub actions
“netlify-cli”: “^10.15.0”,

netlify.toml

[[plugins]]
package = "@netlify/plugin-nextjs"

[build]
  command = "next build"
  publish = ".next"

[functions]
  # Directory with serverless functions, including background 
  # functions, to deploy. This is relative to the base directory
  # if one has been set, or the root directory if
  # a base hasn’t been set.
  directory = "lambda/"

[[redirects]]
  from = "/api/*"
  to = "/.netlify/functions/:splat"
  status = 200

[dev]
  command = "yarn dev"
  functions = "lambda"
  envFiles = [".env.local"]

Below the entire log:


Run yarn netlify deploy --build --prod --debug --message 'v2832399820 ・ 1978a4cec99f96b5b87f2d79d5be0ca5c0e6cbcc'

11 yarn run v1.22.19

12 $ /home/runner/work/blog/blog/node_modules/.bin/netlify deploy --build --prod --debug --message 'v2832399820 ・ 1978a4cec99f96b5b87f2d79d5be0ca5c0e6cbcc'

14

❯ Initial build environment

15 cwd: /home/runner/work/blog/blog

16 featureFlags: []

17 mode: cli

18 siteId: ***

19

20

❯ UI build settings

21 baseRelDir: true

22 build:

23 command: npm run export

24 publish: dist

25 plugins:

26 - inputs: {}

27 package: '@netlify/plugin-nextjs'

28

29 ❯ Resolved build environment

30 branch: main

31 buildDir: /home/runner/work/blog/blog

32 configPath: /home/runner/work/blog/blog/netlify.toml

33 context: production

34 env:

35 - DEPLOY_ID

36 - BUILD_ID

37 - REPOSITORY_URL

38 - NETLIFY_LOCAL

39 - HEAD

40 - COMMIT_REF

41 - PULL_REQUEST

42 - LANG

43 - LANGUAGE

44 - LC_ALL

45 - GATSBY_TELEMETRY_DISABLED

46 - NEXT_TELEMETRY_DISABLED

47

​

48

❯ Resolved config

49

build:

50 command: next build

51 commandOrigin: config

52 publish: /home/runner/work/blog/blog/.next

53 publishOrigin: config

54

functionsDirectory: /home/runner/work/blog/blog/lambda

55

plugins:

56 - inputs: {}

57 origin: config

58 package: '@netlify/plugin-nextjs'

59

redirects:

60 - from: /api/*

61 status: 200

62 to: /.netlify/functions/:splat

63

redirectsOrigin: config

64

​

65

────────────────────────────────────────────────────────────────

66 Netlify Build

67

────────────────────────────────────────────────────────────────

❯ Version

70 @netlify/build 27.9.1

71

​

72

❯ Flags

73 debug: true

74 mode: cli

75

​

76

❯ Current directory

77 /home/runner/work/blog/blog

78

​

79

❯ Config file

80 /home/runner/work/blog/blog/netlify.toml

81

​

82

❯ Resolved config

83 build:

84 command: next build

85 commandOrigin: config

86 publish: /home/runner/work/blog/blog/.next

87 publishOrigin: config

88 functionsDirectory: /home/runner/work/blog/blog/lambda

89 plugins:

90 - inputs: {}

91 origin: config

92 package: '@netlify/plugin-nextjs'

93 redirects:

94 - from: /api/*

95 status: 200

96 to: /.netlify/functions/:splat

97 redirectsOrigin: config

98

​

99

❯ Context

100 production

102

❯ Available plugins

...

​

176

❯ Loading plugins

177 - @netlify/plugin-nextjs@4.14.1 from netlify.toml and package.json (latest 4.12.2, expected 4.12.2, compatible 4.12.2)

178

​

179

────────────────────────────────────────────────────────────────

180 1. @netlify/plugin-nextjs (onPreBuild event)

181

────────────────────────────────────────────────────────────────

182

​

183

No Next.js cache to restore.

184

Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.

185

​

186

❯ Updated config

187 build:

188 command: next build

189 commandOrigin: config

190 environment:

191 - NEXT_PRIVATE_TARGET

192 publish: /home/runner/work/blog/blog/.next

193 publishOrigin: config

194 functionsDirectory: /home/runner/work/blog/blog/lambda

195 plugins:

196 - inputs: {}

197 origin: config

198 package: '@netlify/plugin-nextjs'

199 redirects:

200 - from: /api/*

201 status: 200

202 to: /.netlify/functions/:splat

203 redirectsOrigin: config

204

​

205

(@netlify/plugin-nextjs onPreBuild completed in 444ms)

206

​

207

────────────────────────────────────────────────────────────────

208 2. build.command from netlify.toml

209

────────────────────────────────────────────────────────────────

$ next build

212

info - Linting and checking validity of types...

213

warn - No ESLint configuration detected. Run next lint to begin setup

214

info - Creating an optimized production build...

215

info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled

216

info - Using external babel configuration from /home/runner/work/blog/blog/.babelrc

217

info - Compiled successfully

218

info - Collecting page data...

219

Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps`

220

Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization

info - Generating static pages (0/10)

226

info - Generating static pages (10/10)

227

info - Finalizing page optimization...

228

...

​

253 (build.command completed in 32.5s)

────────────────────────────────────────────────────────────────

256 3. @netlify/plugin-nextjs (onBuild event)

257

────────────────────────────────────────────────────────────────

Patching /home/runner/work/blog/blog/node_modules/next/dist/server/base-server.js

260 Done

261

Patching /home/runner/work/blog/blog/node_modules/next/dist/server/next-server.js

262 Done

263

Moving static page files to serve from CDN...

264

Moved 20 files

265

Using Netlify Edge Functions for image format detection. Set env var "NEXT_DISABLE_EDGE_IMAGES=true" to disable.

266

Netlify configuration property "functions._ipx" value changed to { node_bundler: 'nft' }.

267

Netlify configuration property "functions.___netlify-handler" value changed to {

268 included_files: [

269 '.env',

270 '.env.local',

271 '.env.production',

272 '.env.production.local',

273 './public/locales/**',

274 './next-i18next.config.js',

275 '.next/server/**',

276 '.next/serverless/**',

277 '.next/*.json',

278 '.next/BUILD_ID',

279 '.next/static/chunks/webpack-middleware*.js',

280 '!.next/server/**/*.js.nft.json',

281 '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',

282 '!node_modules/next/dist/server/lib/squoosh/**/*.wasm',

283 '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm',

284 '!node_modules/next/dist/compiled/webpack/bundle4.js',

285 '!node_modules/next/dist/compiled/webpack/bundle5.js',

286 '!node_modules/sharp/**/*'

287 ],

288 external_node_modules: [],

289 node_bundler: 'nft'

290

}.

291

Netlify configuration property "functions.___netlify-odb-handler" value changed to {

292 included_files: [

293 '.env',

294 '.env.local',

295 '.env.production',

296 '.env.production.local',

297 './public/locales/**',

298 './next-i18next.config.js',

299 '.next/server/**',

300 '.next/serverless/**',

301 '.next/*.json',

302 '.next/BUILD_ID',

303 '.next/static/chunks/webpack-middleware*.js',

304 '!.next/server/**/*.js.nft.json',

305 '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',

306 '!node_modules/next/dist/server/lib/squoosh/**/*.wasm',

307 '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm',

308 '!node_modules/next/dist/compiled/webpack/bundle4.js',

309 '!node_modules/next/dist/compiled/webpack/bundle5.js',

310 '!node_modules/sharp/**/*'

311 ],

312 external_node_modules: [],

313 node_bundler: 'nft'

314

}.

315

Netlify configuration property "redirects" value changed to [

316 {

317 from: '/api/*',

318 query: {},

319 to: '/.netlify/functions/:splat',

320 status: 200,

321 force: false,

322 conditions: {},

323 headers: {}

324 },

325 { from: '/_next/static/*', to: '/static/:splat', status: 200 },

326 {

327 from: '/_next/image*',

328 query: { url: ':url', w: ':width', q: ':quality' },

329 to: '/_ipx/w_:width,q_:quality/:url',

330 status: 301

331 },

332 { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },

333 { from: '/cache/*', to: '/404.html', status: 404, force: true },

334 { from: '/server/*', to: '/404.html', status: 404, force: true },

335 { from: '/serverless/*', to: '/404.html', status: 404, force: true },

336 { from: '/trace', to: '/404.html', status: 404, force: true },

337 { from: '/traces', to: '/404.html', status: 404, force: true },

338 {

339 from: '/routes-manifest.json',

340 to: '/404.html',

341 status: 404,

342 force: true

343 },

344 {

345 from: '/build-manifest.json',

346 to: '/404.html',

347 status: 404,

348 force: true

349 },

350 {

351 from: '/prerender-manifest.json',

352 to: '/404.html',

353 status: 404,

354 force: true

355 },

356 {

357 from: '/react-loadable-manifest.json',

358 to: '/404.html',

359 status: 404,

360 force: true

361 },

362 { from: '/BUILD_ID', to: '/404.html', status: 404, force: true },

363 {

364 from: '/api',

365 to: '/.netlify/functions/___netlify-handler',

366 status: 200

367 },

368 {

369 from: '/api/*',

370 to: '/.netlify/functions/___netlify-handler',

371 status: 200

372 },

373 {

374 from: '/config.yml',

375 to: '/config.yml',

376 conditions: { Cookie: [Array] },

377 status: 200

378 },

379 {

380 from: '/favicon.ico',

381 to: '/favicon.ico',

382 conditions: { Cookie: [Array] },

383 status: 200

384 },

385 {

386 from: '/icon.png',

387 to: '/icon.png',

388 conditions: { Cookie: [Array] },

389 status: 200

390 },

391 {

392 from: '/og_image.png',

393 to: '/og_image.png',

394 conditions: { Cookie: [Array] },

395 status: 200

396 },

397 {

398 from: '/site.webmanifest',

399 to: '/site.webmanifest',

400 conditions: { Cookie: [Array] },

401 status: 200

...

509 status: 200

510 },

511 {

512 from: '/images/600x300.png',

513 to: '/images/600x300.png',

514 conditions: { Cookie: [Array] },

515 status: 200

516 },

517 {

518 from: '/styles/content.module.css',

519 to: '/styles/content.module.css',

520 conditions: { Cookie: [Array] },

521 status: 200

522 },

523 {

524 from: '/styles/fonts.css',

525 to: '/styles/fonts.css',

526 conditions: { Cookie: [Array] },

527 status: 200

...

541 {

542 from: '/*',

543 to: '/.netlify/functions/___netlify-handler',

544 status: 200,

545 conditions: { Cookie: [Array] },

546 force: true

547 },

548 {

549 from: '/_next/data/oYaFncYZJlpZEfPkVKbqf/admin.json',

550 to: '/.netlify/functions/___netlify-handler',

551 status: 200,

552 force: false

553 },

554 {

555 from: '/admin',

556 to: '/.netlify/functions/___netlify-handler',

557 status: 200,

558 force: false

559 },

560 {

561 from: '/_next/data/oYaFncYZJlpZEfPkVKbqf/checkout/thankyou.json',

562 to: '/.netlify/functions/___netlify-handler',

563 status: 200,

564 force: false

565 },

566 {

567 from: '/checkout/thankyou',

568 to: '/.netlify/functions/___netlify-handler',

569 status: 200,

570 force: false

571 },

572 {

573 from: '/_next/data/oYaFncYZJlpZEfPkVKbqf/posts/:post.json',

574 to: '/.netlify/builders/___netlify-odb-handler',

575 status: 200,

576 force: false

577 },

578 {

579 from: '/posts/:post',

580 to: '/.netlify/builders/___netlify-odb-handler',

581 status: 200,

582 force: false

583 },

584 {

585 from: '/*',

586 to: '/.netlify/functions/___netlify-handler',

587 status: 200

588 }

589

].

590

​

591

❯ Updated config

592 build:

593 command: next build

594 commandOrigin: config

595 environment:

596 - NEXT_PRIVATE_TARGET

597 publish: /home/runner/work/blog/blog/.next

598 publishOrigin: config

599 functions:

600 ___netlify-handler:

601 external_node_modules: []

602 included_files:

603 - .env

604 - .env.local

605 - .env.production

606 - .env.production.local

607 - ./public/locales/**

608 - ./next-i18next.config.js

609 - .next/server/**

610 - .next/serverless/**

611 - .next/*.json

612 - .next/BUILD_ID

613 - .next/static/chunks/webpack-middleware*.js

614 - '!.next/server/**/*.js.nft.json'

615 - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'

616 - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'

617 - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'

618 - '!node_modules/next/dist/compiled/webpack/bundle4.js'

619 - '!node_modules/next/dist/compiled/webpack/bundle5.js'

620 - '!node_modules/sharp/**/*'

621 node_bundler: nft

622 ___netlify-odb-handler:

623 external_node_modules: []

624 included_files:

625 - .env

626 - .env.local

627 - .env.production

628 - .env.production.local

629 - ./public/locales/**

630 - ./next-i18next.config.js

631 - .next/server/**

632 - .next/serverless/**

633 - .next/*.json

634 - .next/BUILD_ID

635 - .next/static/chunks/webpack-middleware*.js

636 - '!.next/server/**/*.js.nft.json'

637 - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'

638 - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'

639 - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'

640 - '!node_modules/next/dist/compiled/webpack/bundle4.js'

641 - '!node_modules/next/dist/compiled/webpack/bundle5.js'

642 - '!node_modules/sharp/**/*'

643 node_bundler: nft

644 _ipx:

645 node_bundler: nft

646 functionsDirectory: /home/runner/work/blog/blog/lambda

647 plugins:

648 - inputs: {}

649 origin: config

650 package: '@netlify/plugin-nextjs'

651 redirects:

... redirectsOrigin: inline

940

​

941

(@netlify/plugin-nextjs onBuild completed in 501ms)

942

​

────────────────────────────────────────────────────────────────

944 4. Functions bundling

945

────────────────────────────────────────────────────────────────

946

​

947

Packaging Functions from .netlify/functions-internal directory:

948

- ___netlify-handler/___netlify-handler.js

949

- ___netlify-odb-handler/___netlify-odb-handler.js

950

- _ipx/_ipx.js

951

​

952

Packaging Functions from lambda directory:

953

- send-email.ts

954

- stripe-paymentsession-create.ts

955

- stripe-paymentsession-get.ts

956

​

957

​

958

(Functions bundling completed in 27.4s)

959

​

960

────────────────────────────────────────────────────────────────

961 5. Edge Functions bundling

962

────────────────────────────────────────────────────────────────

963

​

964

Packaging Edge Functions from .netlify/edge-functions directory:

965

- ipx

966

Local version of types is outdated, updating: undefined

967

Error checking Deno binary version Error: Command failed with ENOENT: deno --version

....

1016

Using cached Deno CLI from /home/runner/.config/netlify/deno-cli/deno

1017 Download https://62d144a15553b50009af7ac6--edge.netlify.com/bootstrap/index-combined.ts

1018 Download https://deno.land/x/accepts@2.1.1/mod.ts

1019 Download https://deno.land/x/accepts@2.1.1/deps.ts

1020 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/index-combined.ts

1021 Download https://deno.land/x/media_types@v2.9.1/mod.ts

1022 Download https://deno.land/x/negotiator@1.0.1/mod.ts

1023 Download https://deno.land/x/media_types@v2.9.1/db.ts

1024 Download https://deno.land/x/media_types@v2.9.1/deps.ts

1025 Download https://deno.land/x/negotiator@1.0.1/src/charset.ts

1026 Download https://deno.land/x/negotiator@1.0.1/src/encoding.ts

1027 Download https://deno.land/x/negotiator@1.0.1/src/language.ts

1028 Download https://deno.land/x/negotiator@1.0.1/src/media_type.ts

1029 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/server.ts

1030 Download https://deno.land/std@0.99.0/path/mod.ts

1031 Download https://deno.land/x/negotiator@1.0.1/src/types.ts

1032 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/edge_function.ts

1033 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/handler.ts

1034 Download https://deno.land/std@0.136.0/flags/mod.ts

1035 Download https://deno.land/std@0.136.0/http/server.ts

1036 Download https://deno.land/std@0.99.0/_util/os.ts

1037 Download https://deno.land/std@0.99.0/path/_interface.ts

1038 Download https://deno.land/std@0.99.0/path/common.ts

1039 Download https://deno.land/std@0.99.0/path/glob.ts

1040 Download https://deno.land/std@0.99.0/path/posix.ts

1041 Download https://deno.land/std@0.99.0/path/separator.ts

1042 Download https://deno.land/std@0.99.0/path/win32.ts

1043 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/context.ts

1044 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/function_chain.ts

1045 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/headers.ts

1046 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/request.ts

1047 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/cookie_store.ts

1048 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/geo.ts

1049 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/site.ts

1050 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/environment.ts

1051 Download https://62d144a15553b50009af7ac6--edge.netlify.app/bootstrap/response.ts

1052 Download https://deno.land/std@0.136.0/_util/assert.ts

1053 Download https://deno.land/std@0.136.0/async/mod.ts

1054 Download https://deno.land/std@0.99.0/path/_constants.ts

1055 Download https://deno.land/std@0.99.0/path/_util.ts

1056 Download https://deno.land/std@0.99.0/_util/assert.ts

1057 Download https://deno.land/std@0.136.0/async/abortable.ts

1058 Download https://deno.land/std@0.136.0/async/deadline.ts

1059 Download https://deno.land/std@0.136.0/async/debounce.ts

1060 Download https://deno.land/std@0.136.0/async/deferred.ts

1061 Download https://deno.land/std@0.136.0/async/delay.ts

1062 Download https://deno.land/std@0.136.0/async/mux_async_iterator.ts

1063 Download https://deno.land/std@0.136.0/async/pool.ts

1064 Download https://deno.land/std@0.136.0/async/tee.ts

1065 Check file:///home/runner/work/blog/blog/.netlify/edge-functions-dist/f8f010b9-d2bf-48c7-8f83-70e82111253f-pre.js

1066 Bundle file:///home/runner/work/blog/blog/.netlify/edge-functions-dist/f8f010b9-d2bf-48c7-8f83-70e82111253f-pre.js

1067 Emit "/home/runner/work/blog/blog/.netlify/edge-functions-dist/f8f010b9-d2bf-48c7-8f83-70e82111253f.js" (263.19KB)

1068 Edge Functions manifest: {"bundles":[{"asset":"8f60f72ec7910ca40e46baa21b2831edc172c1f751caa7ed55ac87304a5f95ab.js","format":"js"}],"routes":[{"function":"ipx","pattern":"^/_next/image.*/?$"}],"bundler_version":"1.9.0"}

1069 Error compiling schema, function code: const Error0 = scope.Error[0];const schema16 = scope.schema[10];const formats0 = scope.formats[0];return async 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 === "bundler_version"))){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){if(typeof data1.format !== "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++;}}}else {const err9 = {instancePath:instancePath+"/bundles/" + i0,schemaPath:"#/properties/bundles/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}else {const err10 = {instancePath:instancePath+"/bundles",schemaPath:"#/properties/bundles/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}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 err11 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: "function"},message:"must have required property '"+"function"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data5.pattern === undefined){const err12 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: "pattern"},message:"must have required property '"+"pattern"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}for(const key2 in data5){if(!((key2 === "function") || (key2 === "pattern"))){const err13 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data5.function !== undefined){if(typeof data5.function !== "string"){const err14 = {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 = [err14];}else {vErrors.push(err14);}errors++;}}if(data5.pattern !== undefined){let data7 = data5.pattern;if(typeof data7 === "string"){if(!(await formats0.validate(data7))){const err15 = {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 = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {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 = [err16];}else {vErrors.push(err16);}errors++;}if(errors > 0){for(const err17 of vErrors){if((((({"str":"err17"}.keyword !== "errorMessage") && (!{"str":"err17"}.emUsed)) && (({"str":"err17"}.instancePath === instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}) || (({"str":"err17"}.instancePath.indexOf(instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}) === 0) && ({"str":"err17"}.instancePath[instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}.length] === "/")))) && ({"str":"err17"}.schemaPath.indexOf("#/properties/routes/items/properties/pattern") === 0)) && ({"str":"err17"}.schemaPath["#/properties/routes/items/properties/pattern".length] === "/")){{"str":"emErrs0"}.push({"str":"err17"});{"str":"err17"}.emUsed = true;}}if({"str":"emErrs0"}.length){if(vErrors === null){vErrors = [{"str":"err18"}];}else {vErrors.push({"str":"err18"});}errors++;}const emErrs1 = [];for(const err19 of vErrors){if(!{"str":"err19"}.emUsed){{"str":"emErrs1"}.push({"str":"err19"});}}vErrors = emErrs1;errors = {"str":"emErrs1"}.length;}}}else {const err20 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath:instancePath+"/routes",schemaPath:"#/properties/routes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data.bundler_version !== undefined){if(typeof data.bundler_version !== "string"){const err22 = {instancePath:instancePath+"/bundler_version",schemaPath:"#/properties/bundler_version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}else {const err23 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};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) || (({"str":"err24"}.instancePath.indexOf(instancePath) === 0) && ({"str":"err24"}.instancePath[instancePath.length] === "/")))) && ({"str":"err24"}.schemaPath.indexOf("#") === 0)) && ({"str":"err24"}.schemaPath["#".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;}if(errors === 0){return data;}else {throw new Error0(vErrors);}}

────────────────────────────────────────────────────────────────

1072 Internal error during "Edge Functions bundling"

────────────────────────────────────────────────────────────────

1075 Error message

1076 Error: SyntaxError: Unexpected token ':'

1077

​

1078 Error location

1079 During Edge Functions bundling

1080 at validateEdgeFunctionsManifest (file:///home/runner/work/blog/blog/node_modules/@netlify/build/src/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.js:85:11)

1081 at async coreStep (file:///home/runner/work/blog/blog/node_modules/@netlify/build/src/plugins_core/edge_functions/index.js:69:3)

1082 at async fireCoreStep (file:///home/runner/work/blog/blog/node_modules/@netlify/build/src/steps/core_step.js:40:9)

1083 at async tFireStep (file:///home/runner/work/blog/blog/node_modules/@netlify/build/src/time/main.js:20:59)

1084 at async runStep (file:///home/runner/work/blog/blog/node_modules/@netlify/build/src/steps/run_step.js:89:7)

1085 at async pReduce.index (file:///home/runner/work/blog/blog/node_modules/@netlify/build/src/steps/run_steps.js:92:11)

1086 at async Promise.all (index 0)

1087 at async next (file:///home/runner/work/blog/blog/node_modules/p-reduce/index.js:15:44)

1088

​

1089 Resolved config

1090 build:

1091 command: next build

1092 commandOrigin: config

1093 environment:

1094 - NEXT_PRIVATE_TARGET

1095 publish: /home/runner/work/blog/blog/.next

1096 publishOrigin: config

1097 functions:

1098 ___netlify-handler:

1099 external_node_modules: []

1100 included_files:

1101 - .env

1102 - .env.local

1103 - .env.production

1104 - .env.production.local

1105 - ./public/locales/**

1106 - ./next-i18next.config.js

1107 - .next/server/**

1108 - .next/serverless/**

1109 - .next/*.json

1110 - .next/BUILD_ID

1111 - .next/static/chunks/webpack-middleware*.js

1112 - '!.next/server/**/*.js.nft.json'

1113 - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'

1114 - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'

1115 - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'

1116 - '!node_modules/next/dist/compiled/webpack/bundle4.js'

1117 - '!node_modules/next/dist/compiled/webpack/bundle5.js'

1118 - '!node_modules/sharp/**/*'

1119 node_bundler: nft

1120 ___netlify-odb-handler:

1121 external_node_modules: []

1122 included_files:

1123 - .env

1124 - .env.local

1125 - .env.production

1126 - .env.production.local

1127 - ./public/locales/**

1128 - ./next-i18next.config.js

1129 - .next/server/**

1130 - .next/serverless/**

1131 - .next/*.json

1132 - .next/BUILD_ID

1133 - .next/static/chunks/webpack-middleware*.js

1134 - '!.next/server/**/*.js.nft.json'

1135 - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'

1136 - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'

1137 - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'

1138 - '!node_modules/next/dist/compiled/webpack/bundle4.js'

1139 - '!node_modules/next/dist/compiled/webpack/bundle5.js'

1140 - '!node_modules/sharp/**/*'

1141 node_bundler: nft

1142 _ipx:

1143 node_bundler: nft

1144 functionsDirectory: /home/runner/work/blog/blog/lambda

1145 plugins:

1146 - inputs: {}

1147 origin: config

1148 package: '@netlify/plugin-nextjs'

1149 .... redirectsOrigin: inline

1438

error Command failed with exit code 4.

1439

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

1440 Error: Process completed with exit code 4.

Hey @mcolombosperoni!

There are 2 things to try here:

  1. Try building on Netlify CI instead of CLI so that we can see where exactly is the issue happening. If it works when you build from Git, we can narrow this down to be a CLI issue.
  2. Try adding and environment variable named NEXT_USE_NETLIFY_EDGE with the value false and see if the error still persists.

Lastly, we would like to get to the root cause of the issue. So if you’re comfortable sharing a minimal reproduction of this issue in the form of a Git repo, that would help us troubleshoot it better.

Hi @ hrishikesh thanks for the response.

I also tried using the environment variable provided but the behavior and the error are the same. I also tried from the CLI of my laptop instead using the Github Action but also in this case is the same.

The repo for the moment is a private one and it is linked to an organization Repo account. I try to remove some part of the code then I share with you.

Thanks,

Matteo

Again me @hrishikesh here you can find the link with the zipped version of the project. I removed almost everything leaving it like an hello world:

Also with this version I am experiencing the same issue using Netlify cli from my local machine.

Thanks,

Matteo.

Thanks for the reproduction. I’ll test this out and let you know the findings.

Hey @mcolombosperoni,

I tested your reproduction in 2 ways:

  1. I created an even minimal version of your code - that is removed unnecessary dependencies, formatted some stuff, etc. I couldn’t see the problem happen with that.
  2. I thought, I might have removed something important due to which the problem didn’t occur, which is why I downloaded the zip again and without changing anything, tried to deploy. This one worked too.

Are you sure you were able to reproduce this with the code you provided?

I’m also going to escalate this to our developers to see if they know of anything else that could cause this.

hi @hrishikesh strange I tried again again and this is the log:

Can be related with the site configuration? If I send it to you there is a way for you to check?

Thanks,

Matteo

Updated config
  build:
    command: next build
    commandOrigin: config
    environment:
      - NEXT_DISABLE_EDGE_IMAGES
      - NEXT_USE_NETLIFY_EDGE
      - NEXT_PRIVATE_TARGET
    publish: /Users/user/Sites/personal/xxxx/blog/.next
    publishOrigin: config
  functions:
    ___netlify-handler:
      external_node_modules: []
      included_files:
        - .env
        - .env.local
        - .env.production
        - .env.production.local
        - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
        - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/compiled/webpack/bundle4.js'
        - '!node_modules/next/dist/compiled/webpack/bundle5.js'
        - '!node_modules/sharp/**/*'
      node_bundler: nft
    ___netlify-odb-handler:
      external_node_modules: []
      included_files:
        - .env
        - .env.local
        - .env.production
        - .env.production.local
        - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
        - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/compiled/webpack/bundle4.js'
        - '!node_modules/next/dist/compiled/webpack/bundle5.js'
        - '!node_modules/sharp/**/*'
      node_bundler: nft
    _ipx:
      node_bundler: nft
  functionsDirectory: /Users/user/Sites/personal/xxxx/blog/lambda
  plugins:
    - inputs: {}
      origin: config
      package: '@netlify/plugin-nextjs'
  redirects:
    - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /_next/static/*
      status: 200
      to: /static/:splat
    - from: /_next/image*
      query:
        q: ':quality'
        url: ':url'
        w: ':width'
      status: 301
      to: /_ipx/w_:width,q_:quality/:url
    - from: /_ipx/*
      status: 200
      to: /.netlify/builders/_ipx
    - force: true
      from: /cache/*
      status: 404
      to: /404.html
    - force: true
      from: /server/*
      status: 404
      to: /404.html
    - force: true
      from: /serverless/*
      status: 404
      to: /404.html
    - force: true
      from: /trace
      status: 404
      to: /404.html
    - force: true
      from: /traces
      status: 404
      to: /404.html
    - force: true
      from: /routes-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /build-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /prerender-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /react-loadable-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /BUILD_ID
      status: 404
      to: /404.html
    - from: /api
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /api/*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /config.yml
      status: 200
      to: /config.yml
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /favicon.ico
      status: 200
      to: /favicon.ico
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /icon.png
      status: 200
      to: /icon.png
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /og_image.png
      status: 200
      to: /og_image.png
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /site.webmanifest
      status: 200
      to: /site.webmanifest
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeue.ttf
      status: 200
      to: /fonts/HelveticaNeue.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeue.woff
      status: 200
      to: /fonts/HelveticaNeue.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeue.woff2
      status: 200
      to: /fonts/HelveticaNeue.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueBd.ttf
      status: 200
      to: /fonts/HelveticaNeueBd.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueBd.woff
      status: 200
      to: /fonts/HelveticaNeueBd.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueBd.woff2
      status: 200
      to: /fonts/HelveticaNeueBd.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueHv.ttf
      status: 200
      to: /fonts/HelveticaNeueHv.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueHv.woff
      status: 200
      to: /fonts/HelveticaNeueHv.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueHv.woff2
      status: 200
      to: /fonts/HelveticaNeueHv.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueIt.ttf
      status: 200
      to: /fonts/HelveticaNeueIt.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueIt.woff
      status: 200
      to: /fonts/HelveticaNeueIt.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueIt.woff2
      status: 200
      to: /fonts/HelveticaNeueIt.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueLt.ttf
      status: 200
      to: /fonts/HelveticaNeueLt.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueLt.woff
      status: 200
      to: /fonts/HelveticaNeueLt.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueLt.woff2
      status: 200
      to: /fonts/HelveticaNeueLt.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueMed.ttf
      status: 200
      to: /fonts/HelveticaNeueMed.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueMed.woff
      status: 200
      to: /fonts/HelveticaNeueMed.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueMed.woff2
      status: 200
      to: /fonts/HelveticaNeueMed.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /images/600x300.png
      status: 200
      to: /images/600x300.png
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/content.module.css
      status: 200
      to: /styles/content.module.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/fonts.css
      status: 200
      to: /styles/fonts.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/global.css
      status: 200
      to: /styles/global.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/typography.css
      status: 200
      to: /styles/typography.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      force: true
      from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /_next/data/z0pvspx-HhEU409lLrGqg/admin.json
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /admin
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
  redirectsOrigin: inline

(@netlify/plugin-nextjs onBuild completed in 2.6s)

────────────────────────────────────────────────────────────────
  4. Functions bundling                                         
────────────────────────────────────────────────────────────────

Packaging Functions from .netlify/functions-internal directory:
 - ___netlify-handler/___netlify-handler.js
 - ___netlify-odb-handler/___netlify-odb-handler.js
 - _ipx/_ipx.js

Packaging Functions from lambda directory:
 - hello.ts


(Functions bundling completed in 7.7s)

────────────────────────────────────────────────────────────────
  5. Edge Functions bundling                                    
────────────────────────────────────────────────────────────────

Could not check latest version of types: FetchError: request to https://edge.netlify.com/version.txt failed, reason: connect ETIMEDOUT 10.0.0.1:443
    at ClientRequest.<anonymous> (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/edge-bundler/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:527:28)
    at ClientRequest.emit (node:domain:475:12)
    at TLSSocket.socketErrorListener (node:_http_client:454:9)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket.emit (node:domain:475:12)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  erroredSysCall: 'connect'
}
Error checking Deno binary version Error: Command failed with ENOENT: deno --version
spawn deno ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn deno',
  path: 'deno',
  spawnargs: [ '--version' ],
  originalMessage: 'spawn deno ENOENT',
  shortMessage: 'Command failed with ENOENT: deno --version\nspawn deno ENOENT',
  command: 'deno --version',
  escapedCommand: 'deno --version',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Using cached Deno CLI from /Users/user/Library/Preferences/netlify/deno-cli/deno
Bundle file:///Users/user/Sites/personal/xxxx/blog/.netlify/edge-functions-dist/89bd7336-1955-4bc2-a90c-aa0c590e1eae-pre.js
Emit "/Users/user/Sites/personal/xxxx/blog/.netlify/edge-functions-dist/89bd7336-1955-4bc2-a90c-aa0c590e1eae.js" (33.06KB)
Edge Functions manifest: {"bundles":[{"asset":"140ac80912b64fdbaf7bd1814fcd1515c57eeb09381398e4bcff480bf368e918.js","format":"js"}],"routes":[],"bundler_version":"1.12.1"}
Error compiling schema, function code: const Error0 = scope.Error[0];const schema16 = scope.schema[10];const formats0 = scope.formats[0];return async 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 === "bundler_version"))){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){if(typeof data1.format !== "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++;}}}else {const err9 = {instancePath:instancePath+"/bundles/" + i0,schemaPath:"#/properties/bundles/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}else {const err10 = {instancePath:instancePath+"/bundles",schemaPath:"#/properties/bundles/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}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 err11 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: "function"},message:"must have required property '"+"function"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data5.pattern === undefined){const err12 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/required",keyword:"required",params:{missingProperty: "pattern"},message:"must have required property '"+"pattern"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}for(const key2 in data5){if(!((key2 === "function") || (key2 === "pattern"))){const err13 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data5.function !== undefined){if(typeof data5.function !== "string"){const err14 = {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 = [err14];}else {vErrors.push(err14);}errors++;}}if(data5.pattern !== undefined){let data7 = data5.pattern;if(typeof data7 === "string"){if(!(await formats0.validate(data7))){const err15 = {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 = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {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 = [err16];}else {vErrors.push(err16);}errors++;}if(errors > 0){for(const err17 of vErrors){if((((({"str":"err17"}.keyword !== "errorMessage") && (!{"str":"err17"}.emUsed)) && (({"str":"err17"}.instancePath === instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}) || (({"str":"err17"}.instancePath.indexOf(instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}) === 0) && ({"str":"err17"}.instancePath[instancePath+{"_items":["\"/routes/\" + ",{"str":"i1"},"","+","\"/pattern\""]}.length] === "/")))) && ({"str":"err17"}.schemaPath.indexOf("#/properties/routes/items/properties/pattern") === 0)) && ({"str":"err17"}.schemaPath["#/properties/routes/items/properties/pattern".length] === "/")){{"str":"emErrs0"}.push({"str":"err17"});{"str":"err17"}.emUsed = true;}}if({"str":"emErrs0"}.length){if(vErrors === null){vErrors = [{"str":"err18"}];}else {vErrors.push({"str":"err18"});}errors++;}const emErrs1 = [];for(const err19 of vErrors){if(!{"str":"err19"}.emUsed){{"str":"emErrs1"}.push({"str":"err19"});}}vErrors = emErrs1;errors = {"str":"emErrs1"}.length;}}}else {const err20 = {instancePath:instancePath+"/routes/" + i1,schemaPath:"#/properties/routes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath:instancePath+"/routes",schemaPath:"#/properties/routes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data.bundler_version !== undefined){if(typeof data.bundler_version !== "string"){const err22 = {instancePath:instancePath+"/bundler_version",schemaPath:"#/properties/bundler_version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}else {const err23 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};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) || (({"str":"err24"}.instancePath.indexOf(instancePath) === 0) && ({"str":"err24"}.instancePath[instancePath.length] === "/")))) && ({"str":"err24"}.schemaPath.indexOf("#") === 0)) && ({"str":"err24"}.schemaPath["#".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;}if(errors === 0){return data;}else {throw new Error0(vErrors);}}

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

  Error message
  Error: SyntaxError: Unexpected token ':'

  Error location
  During Edge Functions bundling
      at validateEdgeFunctionsManifest (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/build/src/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.js:85:11)
      at async coreStep (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/build/src/plugins_core/edge_functions/index.js:70:3)
      at async fireCoreStep (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/build/src/steps/core_step.js:40:9)
      at async tFireStep (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/build/src/time/main.js:20:59)
      at async runStep (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/build/src/steps/run_step.js:88:7)
      at async pReduce.index (file:///Users/user/Sites/personal/xxxx/blog/node_modules/@netlify/build/src/steps/run_steps.js:91:11)
      at async Promise.all (index 0)
      at async next (file:///Users/user/Sites/personal/xxxx/blog/node_modules/p-reduce/index.js:15:44)

  Resolved config
  build:
    command: next build
    commandOrigin: config
    environment:
      - NEXT_DISABLE_EDGE_IMAGES
      - NEXT_USE_NETLIFY_EDGE
      - NEXT_PRIVATE_TARGET
    publish: /Users/user/Sites/personal/xxxx/blog/.next
    publishOrigin: config
  functions:
    ___netlify-handler:
      external_node_modules: []
      included_files:
        - .env
        - .env.local
        - .env.production
        - .env.production.local
        - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
        - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/compiled/webpack/bundle4.js'
        - '!node_modules/next/dist/compiled/webpack/bundle5.js'
        - '!node_modules/sharp/**/*'
      node_bundler: nft
    ___netlify-odb-handler:
      external_node_modules: []
      included_files:
        - .env
        - .env.local
        - .env.production
        - .env.production.local
        - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
        - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
        - '!node_modules/next/dist/compiled/webpack/bundle4.js'
        - '!node_modules/next/dist/compiled/webpack/bundle5.js'
        - '!node_modules/sharp/**/*'
      node_bundler: nft
    _ipx:
      node_bundler: nft
  functionsDirectory: /Users/user/Sites/personal/xxxx/blog/lambda
  plugins:
    - inputs: {}
      origin: config
      package: '@netlify/plugin-nextjs'
  redirects:
    - from: /api/*
      status: 200
      to: /.netlify/functions/:splat
    - from: /_next/static/*
      status: 200
      to: /static/:splat
    - from: /_next/image*
      query:
        q: ':quality'
        url: ':url'
        w: ':width'
      status: 301
      to: /_ipx/w_:width,q_:quality/:url
    - from: /_ipx/*
      status: 200
      to: /.netlify/builders/_ipx
    - force: true
      from: /cache/*
      status: 404
      to: /404.html
    - force: true
      from: /server/*
      status: 404
      to: /404.html
    - force: true
      from: /serverless/*
      status: 404
      to: /404.html
    - force: true
      from: /trace
      status: 404
      to: /404.html
    - force: true
      from: /traces
      status: 404
      to: /404.html
    - force: true
      from: /routes-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /build-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /prerender-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /react-loadable-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /BUILD_ID
      status: 404
      to: /404.html
    - from: /api
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /api/*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /config.yml
      status: 200
      to: /config.yml
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /favicon.ico
      status: 200
      to: /favicon.ico
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /icon.png
      status: 200
      to: /icon.png
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /og_image.png
      status: 200
      to: /og_image.png
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /site.webmanifest
      status: 200
      to: /site.webmanifest
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeue.ttf
      status: 200
      to: /fonts/HelveticaNeue.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeue.woff
      status: 200
      to: /fonts/HelveticaNeue.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeue.woff2
      status: 200
      to: /fonts/HelveticaNeue.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueBd.ttf
      status: 200
      to: /fonts/HelveticaNeueBd.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueBd.woff
      status: 200
      to: /fonts/HelveticaNeueBd.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueBd.woff2
      status: 200
      to: /fonts/HelveticaNeueBd.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueHv.ttf
      status: 200
      to: /fonts/HelveticaNeueHv.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueHv.woff
      status: 200
      to: /fonts/HelveticaNeueHv.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueHv.woff2
      status: 200
      to: /fonts/HelveticaNeueHv.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueIt.ttf
      status: 200
      to: /fonts/HelveticaNeueIt.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueIt.woff
      status: 200
      to: /fonts/HelveticaNeueIt.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueIt.woff2
      status: 200
      to: /fonts/HelveticaNeueIt.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueLt.ttf
      status: 200
      to: /fonts/HelveticaNeueLt.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueLt.woff
      status: 200
      to: /fonts/HelveticaNeueLt.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueLt.woff2
      status: 200
      to: /fonts/HelveticaNeueLt.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueMed.ttf
      status: 200
      to: /fonts/HelveticaNeueMed.ttf
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueMed.woff
      status: 200
      to: /fonts/HelveticaNeueMed.woff
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /fonts/HelveticaNeueMed.woff2
      status: 200
      to: /fonts/HelveticaNeueMed.woff2
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /images/600x300.png
      status: 200
      to: /images/600x300.png
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/content.module.css
      status: 200
      to: /styles/content.module.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/fonts.css
      status: 200
      to: /styles/fonts.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/global.css
      status: 200
      to: /styles/global.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /styles/typography.css
      status: 200
      to: /styles/typography.css
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      force: true
      from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /_next/data/z0pvspx-HhEU409lLrGqg/admin.json
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /admin
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
  redirectsOrigin: inline
error Command failed with exit code 4.

Interesting. In that case, is it possible for you to link to a new site by running npm init and see if you can reproduce the error in the new site?

Hey @mcolombosperoni,

We checked this with the devs, and the only way they were able to reproduce this was by using Yarn. Could you try to use NPM to see if this works?

Hey @mcolombosperoni, another workaround for now would be adding a resolution to your package.json.

	"resolutions": {
		"ajv": "^8.11.0"
	}

It seems that some netlify dependencies (netlify-cms-app and @netlify/build) use different versions of ajv and yarn seems to get confused and installs them wrong so that it uses the wrong version when we do validation for edge-functions.

I have to dig deeper into what is actually going wrong, but this workaround at least solves it for now.

2 Likes

Thank you very much for the suggestion, I cannot test it right now because I don’t have laptop with me; but next week I’ll do and I’ll let you know.

Hi @danez I tried this workaround and it works. Thanks a lot for the support.