Seeing "Internal error during “Edge Functions bundling” " error on build of a Next.JS App.
Seems to be a similar error to this post: Internal error during "Edge Functions bundling". But I have already tried installing the @netlify/plugin-nextjs directly into the application, but still receiving the error.
The issue also seems to be reported on github but trying the suggested solution of using an older version of the package didn’t work for me either.
This bug report on github seems to suggest a fix was pushed a few days ago but I’m still having this issue.
So the release with the fix came out yesterday, but it looks like there are still bugs that are being surfaced from the issue. My builds are still failing
5. Edge Functions bundling
────────────────────────────────────────────────────────────────
Packaging Edge Functions from .netlify/edge-functions directory:
- rsc-data
Packaging Edge Functions from netlify/edge-functions directory:
- hello
Local version of types is up-to-date: 643581608391e3000851cc94
No globalVersion or semver not satisfied. globalVersion: undefined, versionRange: ^1.22.0
Using cached Deno CLI from /Users/miketalley/Library/Preferences/netlify/deno-cli/deno
No globalVersion or semver not satisfied. globalVersion: undefined, versionRange: ^1.22.0
No globalVersion or semver not satisfied. globalVersion: undefined, versionRange: ^1.22.0
Using cached Deno CLI from /Users/miketalley/Library/Preferences/netlify/deno-cli/deno
Using cached Deno CLI from /Users/miketalley/Library/Preferences/netlify/deno-cli/deno
No in-source config found for edge function at '/Users/miketalley/Repos/liblab-lotr/netlify/edge-functions/hello.ts'
TypeError: Cannot read properties of null (reading 'endsWith')
at file:///Users/miketalley/Repos/liblab-lotr/.netlify/edge-functions/edge-shared/rsc-data.ts:38:48
at Array.filter (<anonymous>)
at getRscDataRouter (file:///Users/miketalley/Repos/liblab-lotr/.netlify/edge-functions/edge-shared/rsc-data.ts:38:8)
at file:///Users/miketalley/Repos/liblab-lotr/.netlify/edge-functions/rsc-data/rsc-data.ts:4:17
Could not load edge function at '/Users/miketalley/Repos/liblab-lotr/.netlify/edge-functions/rsc-data/rsc-data.ts'
Internal error during "Edge Functions bundling"
────────────────────────────────────────────────────────────────
Error message
TypeError: Expected a string
Error location
During Edge Functions bundling
at module.exports (/usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/glob-to-regexp/index.js:3:11)
at pathToRegularExpression (file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/dist/node/manifest.js:94:31)
at getRegularExpression (file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/dist/node/manifest.js:115:12)
at file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/dist/node/manifest.js:60:25
at Array.forEach (<anonymous>)
at generateManifest (file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/dist/node/manifest.js:55:18)
at writeManifest (file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/dist/node/manifest.js:136:22)
at bundle (file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/edge-bundler/dist/node/bundler.js:78:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async coreStep (file:///usr/local/lib/node_modules/netlify-cli/node_modules/@netlify/build/lib/plugins_core/edge_functions/index.js:35:30)
The changes of that appdir version have been merged into the regular version for a long time now. You should not be using the appdir version explicitly as it’s most likely very outdated at this point.
Regarding the original issue though, we’d confirm with the devs about the actual solution.