Edge Function bundling - error

This was working fine 2 hours ago.
Now the build fails in Edge Functions bundling part.
Seams to be a netlify internal error.

I can build the project with yarn build locally without any errors.

This is Nuxt3 project with

  nitro: {
    preset: "netlify_edge",
  },

Full Netlify Build Log

9:55:20 PM: build-image version: 50f2c07b4ff67fac131b5b345ef7efb7e0ab9dac (focal)
9:55:20 PM: buildbot version: f9b2ff41fa484cce777041aeb0d52b8e540d667c
9:55:20 PM: Fetching cached dependencies
9:55:20 PM: Failed to fetch cache, continuing with build
9:55:20 PM: Starting to prepare the repo for build
9:55:21 PM: No cached dependencies found. Cloning fresh repo
9:55:21 PM: git clone --filter=blob:none https://github.com/SveinnB/prior
9:55:21 PM: Preparing Git Reference refs/heads/main
9:55:23 PM: Custom publish path detected. Proceeding with the specified path: "landing-page-3/dist"
9:55:23 PM: Starting to install dependencies
9:55:23 PM: Python version set to 3.8
9:55:24 PM: Attempting Ruby version 2.7.2, read from environment
9:55:24 PM: Using Ruby version 2.7.2
9:55:25 PM: Started restoring cached go cache
9:55:25 PM: Finished restoring cached go cache
9:55:26 PM: go version go1.19.13 linux/amd64
9:55:26 PM: Using PHP version 8.0
9:55:27 PM: v18.18.2 is already installed.
9:55:27 PM: Now using node v18.18.2 (npm v9.8.1)
9:55:27 PM: Enabling Node.js Corepack
9:55:28 PM: Started restoring cached build plugins
9:55:28 PM: Finished restoring cached build plugins
9:55:28 PM: Started restoring cached corepack dependencies
9:55:28 PM: Finished restoring cached corepack dependencies
9:55:28 PM: Started restoring cached yarn cache
9:55:28 PM: Finished restoring cached yarn cache
9:55:28 PM: No yarn workspaces detected
9:55:28 PM: Started restoring cached node modules
9:55:28 PM: Finished restoring cached node modules
9:55:28 PM: Installing npm packages using Yarn version 1.22.19
9:55:28 PM: yarn install v1.22.19
9:55:28 PM: [1/5] Validating package.json...
9:55:28 PM: [2/5] Resolving packages...
9:55:29 PM: [3/5] Fetching packages...
9:55:38 PM: warning vscode-languageclient@7.0.0: The engine "vscode" appears to be invalid.
9:55:38 PM: [4/5] Linking dependencies...
9:55:38 PM: warning " > @nuxt/devtools@1.0.2" has unmet peer dependency "vite@*".
9:55:38 PM: warning "@nuxt/devtools > @nuxt/devtools-kit@1.0.2" has unmet peer dependency "vite@*".
9:55:38 PM: warning "@nuxt/devtools > vite-plugin-inspect@0.7.42" has unmet peer dependency "vite@^3.1.0 || ^4.0.0 || ^5.0.0-0".
9:55:38 PM: warning "@nuxt/devtools > vite-plugin-vue-inspector@4.0.0" has unmet peer dependency "vite@^3.0.0-0 || ^4.0.0-0".
9:55:38 PM: warning "vuetify-nuxt-module > vite-plugin-vuetify@1.0.2" has unmet peer dependency "vite@^2.7.0 || ^3.0.0 || ^4.0.0".
9:55:41 PM: [5/5] Building fresh packages...
9:55:43 PM: $ nuxt prepare
9:55:45 PM: [success] Types generated in .nuxt
9:55:45 PM: Done in 16.96s.
9:55:45 PM: npm packages installed using Yarn
9:55:46 PM: Successfully installed dependencies
9:55:46 PM: Starting build script
9:55:47 PM: Detected 1 framework(s)
9:55:47 PM: "nuxt" at version "3.8.1"
9:55:47 PM: Section completed: initializing
9:55:48 PM: ​
9:55:48 PM: Netlify Build                                                 
9:55:48 PM: ────────────────────────────────────────────────────────────────
9:55:48 PM: ​
9:55:48 PM: ❯ Version
9:55:48 PM:   @netlify/build 29.26.3
9:55:48 PM: ​
9:55:48 PM: ❯ Flags
9:55:48 PM:   baseRelDir: true
9:55:48 PM:   buildId: 655149c777b78a4c658dbf5c
9:55:48 PM:   deployId: 655149c777b78a4c658dbf5e
9:55:48 PM: ​
9:55:48 PM: ❯ Current directory
9:55:48 PM:   /opt/build/repo/landing-page-3
9:55:48 PM: ​
9:55:48 PM: ❯ Config file
9:55:48 PM:   No config file was defined: using default values.
9:55:48 PM: ​
9:55:48 PM: ❯ Context
9:55:48 PM:   production
9:55:48 PM: ​
9:55:48 PM: Build command from Netlify app                                
9:55:48 PM: ────────────────────────────────────────────────────────────────
9:55:48 PM: ​
9:55:48 PM: $ yarn build
9:55:49 PM: yarn run v1.22.19
9:55:49 PM: $ nuxt build
9:55:49 PM: [log] Nuxt 3.8.1 with Nitro 2.7.2
9:55:51 PM: [info] Building client...
9:55:51 PM: [info] vite v4.5.0 building for production...
9:55:51 PM: [info] transforming...
9:55:54 PM: [info] ✓ 294 modules transformed.
9:55:54 PM: Inspect report generated at /opt/build/repo/landing-page-3/.nuxt/analyze/.vite-inspect
9:55:54 PM: [info] rendering chunks...
9:55:54 PM: [info] computing gzip size...
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-100-5.ca7eea0c.woff2     5.39 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-300-12.51f3f418.woff2    5.47 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-900-40.3a38c967.woff2    5.47 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-700-33.4ec57f2a.woff2    5.55 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-400-19.77b24796.woff2    5.56 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-500-26.0948409a.woff2    5.60 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-700-32.1c9cc76f.woff2    6.94 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-100-4.8c3798e3.woff2     7.01 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-500-25.713780d8.woff2    7.02 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-900-39.2550c2e2.woff2    7.04 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-400-18.daf51ab5.woff2    7.11 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-300-11.455c2c1a.woff2    7.12 kB
9:55:54 PM: [info] .nuxt/dist/client/manifest.json                         8.97 kB │ gzip:  1.05 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-100-2.638764dc.woff2     9.18 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-300-9.47aa3bfa.woff2     9.58 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-400-16.495d38d4.woff2    9.63 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-700-30.6a84eeee.woff2    9.64 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-900-37.9fdb12ce.woff2    9.70 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-500-23.3728fbdd.woff2    9.84 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-900-41.2781e9e7.woff2   11.76 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-300-13.b076e863.woff2   11.80 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-500-27.7f1c829b.woff2   11.80 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-100-6.10b31f4c.woff2    11.80 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-700-34.fc66f942.woff2   11.82 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-400-20.3c23eb02.woff2   11.87 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-700-29.3c505383.woff2   14.68 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-100-1.8e48cf20.woff2    14.69 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-900-36.f265cee6.woff2   14.86 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-500-22.aeed0e51.woff2   14.97 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-300-8.435e4b7f.woff2    15.00 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-400-15.b7ef2cd1.woff2   15.34 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-300-14.f7591131.woff2   15.74 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-400-21.f6734f81.woff2   15.74 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-900-42.7e262106.woff2   15.75 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-100-7.0f303f31.woff2    15.76 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-700-35.f5aebdfe.woff2   15.86 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/Roboto-500-28.b0195382.woff2   15.92 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/log-work.fb380b59.webm        184.91 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/log-work.149ae7eb.mp4         368.94 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/default.532b712b.css            0.99 kB │ gzip:  0.43 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/index.21cce404.css              5.08 kB │ gzip:  1.02 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/entry.d15006e2.css             24.15 kB │ gzip:  4.09 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/default.c71d545d.js             3.26 kB │ gzip:  1.46 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/index.49030dc8.js               7.52 kB │ gzip:  2.99 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/nuxt-img.e557ff06.js            9.55 kB │ gzip:  3.89 kB
9:55:54 PM: [info] .nuxt/dist/client/_nuxt/entry.06078c83.js             207.57 kB │ gzip: 77.03 kB
9:55:54 PM: [info] ✓ built in 2.91s
9:55:54 PM: [success] Client built in 2932ms
9:55:54 PM: [info] Building server...
9:55:54 PM: [info] vite v4.5.0 building SSR bundle for production...
9:55:54 PM: [info] transforming...
9:55:56 PM: [info] ✓ 246 modules transformed.
9:55:57 PM: Inspect report generated at /opt/build/repo/landing-page-3/.nuxt/analyze/.vite-inspect
9:55:57 PM: [info] rendering chunks...
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/default-styles.29f069ed.mjs         0.15 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/index-styles.8ff18704.mjs           0.28 kB
9:55:57 PM: [info] .nuxt/dist/server/styles.mjs                                0.37 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles.df920e2c.mjs           0.73 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-2.mjs-c2a46692.js      0.17 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/index-styles-2.mjs-96e6a61c.js      0.26 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/index-styles-1.mjs-11e05955.js      0.27 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/index-styles-4.mjs-6dd4a571.js      0.35 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-4.mjs-5beebf85.js      0.41 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/default-styles-2.mjs-d85ddf19.js    0.57 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/default-styles-1.mjs-1925545f.js    0.64 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-11.mjs-0ef53e1a.js     0.72 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-7.mjs-6b8d0267.js      0.85 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-9.mjs-16e27c12.js      0.96 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/island-renderer-11a47fb4.js         1.08 kB │ map:   1.40 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-8.mjs-d6c87111.js      1.44 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-10.mjs-20cc55f4.js     2.03 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/index-styles-3.mjs-1ca2d3ce.js      4.92 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-6.mjs-3c26b9c4.js      8.98 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-5.mjs-49fb97a5.js      9.64 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/default-6edfc03d.js                16.15 kB │ map:   9.70 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/nuxt-img-83d3176b.js               19.57 kB │ map:  46.53 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-3.mjs-d6b415ee.js     22.44 kB │ map:   0.11 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/index-58e716a5.js                  58.76 kB │ map:  15.29 kB
9:55:57 PM: [info] .nuxt/dist/server/server.mjs                              164.56 kB │ map: 349.88 kB
9:55:57 PM: [info] .nuxt/dist/server/_nuxt/entry-styles-1.mjs-10ab79c6.js    242.98 kB │ map:   0.11 kB
9:55:57 PM: [info] ✓ built in 2.56s
9:55:57 PM: [success] Server built in 2564ms
9:55:57 PM: [success] [nitro] Generated public dist
9:55:57 PM: [info] [nitro] Building Nitro Server (preset: `netlify_edge`)
9:56:28 PM: [success] [nitro] Nitro server built
9:56:28 PM:   └─ .netlify/edge-functions/server/server.js (3.12 MB) (774 kB gzip)
9:56:28 PM: Σ Total size: 3.12 MB (774 kB gzip)
9:56:29 PM: Done in 39.93s.
9:56:29 PM: ​
9:56:29 PM: (build.command completed in 40.1s)
9:56:29 PM: ​
9:56:29 PM: Edge Functions bundling                                       
9:56:29 PM: ────────────────────────────────────────────────────────────────
9:56:29 PM: ​
9:56:29 PM: Packaging Edge Functions from .netlify/edge-functions directory:
9:56:29 PM:  - server
9:56:35 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
9:56:35 PM: Error: [unenv] crypto.getHashes is not implemented yet!
9:56:35 PM:     at createNotImplementedError (file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:132636)
9:56:35 PM:     at Object.assign.__unenv__ [as getHashes] (file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:132942)
9:56:35 PM:     at Object../node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js (file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:176795)
9:56:35 PM:     at __webpack_require__ (file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:225925)
9:56:35 PM:     at file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:230383
9:56:35 PM:     at file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:368595
9:56:35 PM:     at file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:368619
9:56:35 PM:     at requireJiti (file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1:368622)
9:56:35 PM:     at lib$3 (file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1849:442349)
9:56:35 PM:     at file:///opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js:1849:464885
9:56:35 PM: ​
9:56:35 PM: Bundling of edge function failed                              
9:56:35 PM: ────────────────────────────────────────────────────────────────
9:56:35 PM: ​
9:56:35 PM:   Error message
9:56:35 PM:   Could not load edge function at "/opt/build/repo/landing-page-3/.netlify/edge-functions/server/server.js". More on the Edge Functions API at https://ntl.fyi/edge-api.
9:56:35 PM: ​
9:56:35 PM:   Error location
9:56:35 PM:   While bundling edge function
9:56:35 PM: ​
9:56:35 PM:   Resolved config
9:56:35 PM:   build:
9:56:35 PM:     base: /opt/build/repo/landing-page-3
9:56:35 PM:     command: yarn build
9:56:35 PM:     commandOrigin: ui
9:56:35 PM:     publish: /opt/build/repo/landing-page-3/dist
9:56:35 PM:     publishOrigin: ui
9:56:35 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:56:35 PM: Failing build: Failed to build site
9:56:35 PM: Finished processing build request in 1m15.095s

Hi :wave:t6: would you mind sharing the site id/site name/slug? I cannot locate which site this is.

This was probably my fault. I was messing around with nuxt-security module witch was causing a runtime error in browser console. After I disabled the module and change the build from yarn build to yarn generate netlify was able to build and setup the edge function :slight_smile:

Hey Sveinn,

Thanks for following up and confirming! Please don’t hesitate to reach back out if there’s anything else we can look into.