Next App Edge Function Bundling Error

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.

I have previously been able to deploy my app.

1 Like

Refer to:

When do releases typically go out?

We don’t typically have a specific date for releases.

are there any short term solutions that can be implemented?

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

I’m also experiencing this error with my build.

  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)

As mentioned in Deploy Next.js 13 on Netlify Today you might need to install npm install -D @netlify/plugin-nextjs@appdir.

For me it fixes the deployment so far, but I still run into other issues on the deployed site that I am still investigating.

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.

Was there any updates on this? My build with Next 13.3 still fails

Hi @manucoffin this was fixed. Can you please attach a screenshot of you most recent failed build/deploy?