Please help because I don’t how to fix it.I’m deploying Angular 18 SSR to netlify and getting every time the same error.Tried a lot to fix it somehow but could’t.
The error belove:
2:31:27 PM: Packaging Edge Functions from .netlify/edge-functions directory:
2:31:27 PM: - angular-ssr
2:31:36 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
2:31:35 PM: TypeError: Cannot read properties of undefined (reading ‘FinalizationRegistry’)
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-ZGQMVWZX.mjs:2:31422
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-WUI6SWGE.mjs:2:1064
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-ZGQMVWZX.mjs:39:10358
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-WUI6SWGE.mjs:2:1064
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-ZGQMVWZX.mjs:45:4463
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-WUI6SWGE.mjs:2:1064
2:31:35 PM: at file:///opt/build/repo/dist/pledik-handmade/server/chunk-ZGQMVWZX.mjs:66:1695
2:31:35 PM:
2:31:35 PM: Bundling of edge function failed
2:31:35 PM: ────────────────────────────────────────────────────────────────
2:31:35 PM:
2:31:35 PM: Error message
2:31:35 PM: Could not load edge function at ‘/opt/build/repo/.netlify/edge-functions/angular-ssr/angular-ssr.mjs’. More on the Edge Functions API at Edge Functions API | Netlify Docs.
2:31:35 PM:
2:31:35 PM: Error location
2:31:35 PM: While bundling edge function
2:31:35 PM:
2:31:35 PM: Resolved config
2:31:35 PM: build:
2:31:35 PM: command: ng build
2:31:35 PM: commandOrigin: config
2:31:35 PM: publish: /opt/build/repo/dist/pledik-handmade/browser
2:31:35 PM: publishOrigin: config
2:31:35 PM: functionsDirectory: /opt/build/repo/netlify/functions
2:31:35 PM: plugins:
2:31:35 PM: - inputs: {}
2:31:35 PM: origin: ui
2:31:35 PM: package: ‘@netlify/angular-runtime’
2:31:35 PM: redirects:
2:31:36 PM: - from: /*
status: 200
to: /index.html
redirectsOrigin: config
2:31:36 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:31:36 PM: Failing build: Failed to build site
2:31:36 PM: Finished processing build request in 1m12.506s