404 Not Found with getServerSideProps
See original GitHub issueI follow https://www.serverless.com/plugins/serverless-nextjs-plugin this article to run project nextjs, i18next-next. But all good with getStaticProps, with getServerSideProps I have error This side not found in production
My configure serverless.yml
willink-web:
component: '@sls-next/serverless-component@latest'
inputs:
minifyHandlers: true
logLambdaExecutionTimes: true
useServerlessTraceTarget: true
build:
postBuildCommands: ['node scripts/post-build.js']
memory:
defaultLambda: 1024
apiLambda: 1024
imageLambda: 1024
runtime:
defaultLambda: 'nodejs14.x'
apiLambda: 'nodejs14.x'
imageLambda: 'nodejs14.x'
timeout:
defaultLambda: 20
apiLambda: 15
imageLambda: 15
name:
defaultLambda: 'penrag8-el7ggmc'
apiLambda: 'penrag8-el7ggmc'
imageLambda: 'penrag8-el7ggmc'
bucketName: 'penrag8-k5q73ne'
cloudfront:
# # if you want to use an existing cloudfront distribution, provide it here
distributionId: E3NNVQYBUILHBD
# this is the default cache behaviour of the cloudfront distribution
# the origin-request edge lambda associated to this cache behaviour does the pages server side rendering
defaults:
forward:
headers:
[
CloudFront-Is-Desktop-Viewer,
CloudFront-Is-Mobile-Viewer,
CloudFront-Is-Tablet-Viewer,
]
# this is the cache behaviour for next.js api pages
api:
minTTL: 10
maxTTL: 10
defaultTTL: 10
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
Next.js, redirect to 404 page inside getServerSideProps
The notFound boolean allows the page to return a 404 status and 404 Page. export async function getServerSideProps(context) { const placeId ...
Read more >How to return a 404 error in getServerSideProps with Next.js
Ever wondered how to redirect to a 404 error in getServerSideProps with Next.js? Follow our guide for the simples solution we've found!
Read more >res.statusCode=404 in getServerSideProps results in ... - GitHub
So the current behaviour is: if I request /my-route I get a 404 http status code and the rendered 404 page; if I...
Read more >Problem of 404 when using "getServerSideProps" - Support
Hello, I'm using “getServerSideProps” for a page and I get a 404 error on it. I've seen on this page that I need...
Read more >Data Fetching: getServerSideProps - Next.js
The notFound boolean allows the page to return a 404 status and 404 Page. With notFound: true , the page will return a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tranthaison1231 I am closing this issue as it should be fixed; the related PR should also try to automatically any default required files so postBuildCommands are not needed, unless you have a custom path/config, in which case you will need to write your own script
Thank you so much