DEV Community

Discussion on: Deploy a Next.js App to AWS Amplify

Collapse
 
marcostreng profile image
Marco Streng • Edited

Great article, thanks!

I've just created a new app from the Next.js starter and added a page with some server-side data fetching (SSR).
Build and deployment are running successfully. Amplify detects the framework correct with "Next.js SSR". Also the Lambda@Edge exists after the deployment. But there is no trigger connected as far as I can see.

But when I navigate to the SSR Page in the browser I always receive a "503 ERROR
The request could not be satisfied."

Maybe anyone got an idea?

Collapse
 
aspittel profile image
Ali Spittel

Hey, thanks for bubbling this up! The engineering team is checking into it and I'll let you know when I hear back!

Collapse
 
marcostreng profile image
Marco Streng • Edited

After some investigation I found out that I have to set webpack to version 4 in my next.config.js.
The latest Next.js uses webpack 5 as default which is not working with AWS Amplify Hosting right now.

Thread Thread
 
sohammondal profile image
Soham Mondal

Yes, you're right. Downgrading Next.js to v11.1.3 and setting webpack5: false in next.config.js fixed the issue.

Collapse
 
alacret profile image
Angel Lacret

Some comments have been hidden by the post's author - find out more