Hello all,
Recently, builds started failing in Netlify with the following in the logs…
ℹ Building Nitro Server (preset: netlify-edge) nitro 1:48:17 AM
✔ Nitro server built nitro 1:49:18 AM
└─ .netlify/edge-functions/server/server.js (2.85 MB) (788 kB gzip)
Σ Total size: 2.85 MB (788 kB gzip)
├─ /__sitemap__/routes.json (0ms) nitro 1:49:18 AM
(build.command completed in 1m 24s)
Edge Functions bundling
────────────────────────────────────────────────────────────────
Packaging Edge Functions from .netlify/edge-functions directory:
- server
error: Uncaught (in promise) Error: The module's source code could not be parsed: Unexpected character '\u{7f}' at file:///root/.netlify/edge-functions/server/server.js:2:4
`||`|||`|}}}}}}`
}}}}}}}}`|`}}}` `...
~
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at <anonymous> (file:///home/linuxbrew/.linuxbrew/Cellar/netlify-cli/16.4.2/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm.generated.js:417:19)
Bundling of edge function failed
────────────────────────────────────────────────────────────────
Error message
error: Uncaught (in promise) Error: The module's source code could not be parsed: Unexpected character '\u{7f}' at file:///root/.netlify/edge-functions/server/server.js:2:4
`||`|||`|}}}}}}`
}}}}}}}}`|`}}}` `...
~
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at <anonymous> (file:///home/linuxbrew/.linuxbrew/Cellar/netlify-cli/16.4.2/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm.generated.js:417:19)
Error location
While bundling edge function
Resolved config
build:
command: NITRO_PRESET=netlify-edge pnpm run build
This seems to be related specifically when using netlify build
from the command line OR when an Automatic Deploy is trigger due to a git push.
Executing NITRO_PRESET=netlify-edge pnpm run build
completes successfully as you can see form the logs.
Any thoughts?
I appreciate you!
Thanks!