Error on deploy: Invalid AWS Lambda parameters used in this request

I was following this thread because I was running into the server.edge issue. I followed the solution by adding a prebuild.js file in the root dir, adding the script to my package.json and adding the __NEXT_PRIVATE_PREBUNDLED_REACT=next variable in the UI. The server.edge problem went away, but I’m left with the error below and have not been able to find anything else in the forums or online, which leads me to believe it’s something simple. This is my first build/deploy with NextJS, NextAuth and Netlify. I’ve built other stacks with Netlify so I’m somewhat familiar with the platform. Would love any insights or help to try and get this running.

...
Functions bundling                                            
2:54:04 PM: ────────────────────────────────────────────────────────────────
2:54:04 PM: ​
2:54:04 PM: Packaging Functions from .netlify/functions-internal directory:
2:54:04 PM:  - ___netlify-handler/___netlify-handler.js
2:54:04 PM:  - ___netlify-odb-handler/___netlify-odb-handler.js
2:54:04 PM:  - _ipx/_ipx.js
2:54:04 PM: ​
2:54:27 PM: ​
2:54:27 PM: (Functions bundling completed in 23.2s)
2:54:27 PM: ​
2:54:27 PM: Edge Functions bundling                                       
2:54:27 PM: ────────────────────────────────────────────────────────────────
2:54:27 PM: ​
2:54:27 PM: Packaging Edge Functions from .netlify/edge-functions directory:
2:54:27 PM:  - next_middleware
2:54:27 PM:  - rsc-data
2:54:34 PM: ​
2:54:34 PM: (Edge Functions bundling completed in 6.6s)
2:54:34 PM: ​
2:54:34 PM: @netlify/plugin-nextjs (onPostBuild event)                    
2:54:34 PM: ────────────────────────────────────────────────────────────────
2:54:34 PM: ​
2:54:34 PM: Next.js cache saved.
2:54:34 PM: πŸ§ͺ Thank you for testing appDir support on Netlify. For known issues and to give feedback, visit https://ntl.fyi/next-13-feedback
2:54:34 PM: ​
2:54:34 PM: (@netlify/plugin-nextjs onPostBuild completed in 141ms)
2:54:34 PM: ​
2:56:32 PM: (Netlify Build completed in 2m 49.5s)
2:56:32 PM: Execution cancelled
2:56:32 PM: Error running command: Command was cancelled
2:56:32 PM: Failing build: Failed to build site
2:56:32 PM: Finished processing build request in 3m5.021s
Deploying
Complete
2:54:37 PM: Invalid AWS Lambda parameters used in this request.
2:54:38 PM: Invalid AWS Lambda parameters used in this request.
2:54:38 PM: Invalid AWS Lambda parameters used in this request.
2:54:38 PM: Invalid AWS Lambda parameters used in this request.
2:54:39 PM: Invalid AWS Lambda parameters used in this request.
2:54:39 PM: Invalid AWS Lambda parameters used in this request.
2:54:39 PM: Invalid AWS Lambda parameters used in this request.
2:54:40 PM: Invalid AWS Lambda parameters used in this request.
2:54:41 PM: Invalid AWS Lambda parameters used in this request.
2:54:41 PM: Invalid AWS Lambda parameters used in this request.
2:54:42 PM: Invalid AWS Lambda parameters used in this request.
2:54:42 PM: Invalid AWS Lambda parameters used in this request.
2:54:44 PM: Invalid AWS Lambda parameters used in this request.
2:54:45 PM: Invalid AWS Lambda parameters used in this request.
2:54:45 PM: Invalid AWS Lambda parameters used in this request.
2:54:48 PM: Invalid AWS Lambda parameters used in this request.
2:54:48 PM: Invalid AWS Lambda parameters used in this request.
2:54:48 PM: Invalid AWS Lambda parameters used in this request.
2:54:53 PM: Invalid AWS Lambda parameters used in this request.
2:54:53 PM: Invalid AWS Lambda parameters used in this request.
2:54:56 PM: Invalid AWS Lambda parameters used in this request.
2:55:01 PM: Invalid AWS Lambda parameters used in this request.
2:55:03 PM: Invalid AWS Lambda parameters used in this request.
2:55:08 PM: Invalid AWS Lambda parameters used in this request.
2:55:11 PM: Invalid AWS Lambda parameters used in this request.
2:55:13 PM: Invalid AWS Lambda parameters used in this request.
2:55:24 PM: Invalid AWS Lambda parameters used in this request.
2:55:25 PM: Invalid AWS Lambda parameters used in this request.
2:55:40 PM: Invalid AWS Lambda parameters used in this request.
2:55:48 PM: Invalid AWS Lambda parameters used in this request.
2:55:55 PM: Invalid AWS Lambda parameters used in this request.
2:55:56 PM: Invalid AWS Lambda parameters used in this request.
2:54:34 PM: Deploy site                                                   
2:54:34 PM: ────────────────────────────────────────────────────────────────
2:54:34 PM: ​
2:54:34 PM: Starting to deploy site from '.next'
2:54:34 PM: Calculating files to upload
2:54:34 PM: 6 new files to upload
2:54:34 PM: 3 new functions to upload
2:55:56 PM: Failed to upload file: _ipx
2:55:56 PM: Failed to upload file: ___netlify-odb-handler
2:56:32 PM: Failed to upload file: ___netlify-handler
2:56:32 PM: Section completed: deploying
2:56:32 PM: Site deploy was successfully initiated
2:56:32 PM: ​
2:56:32 PM: (Deploy site completed in 1m 57.9s)

Hey @ChrisS,

I’m closing this in favour of the helpesk ticket.

Hi @ChrisS,
I’m facing the exact same error, have you found any workaround ?
I would greatly appreciate any help !

I was using the __NEXT_PRIVATE_PREBUNDLED_REACT=next as a env variable in Netlify, when you’re not supposed to. All you need is just the prebuild.js from the linked thread in the first post.

1 Like

Also facing this issue following on from the linked thread in the post. NextJS.

@appsddc, if you’re going to apply solutions from a thread, please read the thread fully. The post says multiple times:

  1. This environment variable is not supported
  2. There’s no complete fix for this issue yet

You can choose to use any of the community solutions that thread has, but we cann’t support those.