Json generated by getServerSideProps not found

The issue that I am facing is similar to this

After some investigation, I found that the JSON that must be returned by getServerSideProps which is redirected to ___netlify-handler it’s not been generated and the URL response is 404

Hi :wave:t6: welcome back to the forums! it would be helpful to share the error message from the Netlify logs and a code snippet of your package.json file for further investigation.

for the code snippet, you can use this repo to replicate the bug.

and this is my package.json file

{
  "name": "virtual-agency-poc",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "build": "next build",
    "codegen": "graphql-codegen --watch",
    "predev": "yarn generate",
    "dev": "next dev",
    "debug": "NODE_OPTIONS='--inspect' next dev",
    "generate": "graphql-codegen",
    "lint": "next lint",
    "lint:fix": "next lint --fix",
    "start": "next start",
    "prepare": "husky install",
    "extract-translations": "yarn i18next --config i18next-parser.config.js"
  },
  "dependencies": {
    "@aws-sdk/client-cognito-identity": "^3.427.0",
    "@aws-sdk/client-cognito-identity-provider": "^3.425.0",
    "@aws-sdk/client-sts": "^3.427.0",
    "@aws-sdk/credential-provider-cognito-identity": "^3.427.0",
    "@aws-sdk/smithy-client": "^3.374.0",
    "@emotion/cache": "^11.11.0",
    "@emotion/css": "^11.11.2",
    "@emotion/react": "^11.11.1",
    "@emotion/server": "^11.11.0",
    "@emotion/styled": "^11.11.0",
    "@hookform/resolvers": "^3.3.1",
    "@mui/icons-material": "^5.14.12",
    "@mui/material": "^5.14.12",
    "@tanstack/react-query": "^4.33.0",
    "@tanstack/react-query-devtools": "^4.33.0",
    "amazon-cognito-identity-js": "^6.3.5",
    "axios": "^1.5.0",
    "graphql": "^16.8.0",
    "jose": "^4.14.4",
    "next": "13.4.19",
    "next-auth": "^4.23.1",
    "next-translate": "^2.6.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-hook-form": "^7.45.4",
    "tss-react": "^4.9.2",
    "uuid": "^9.0.1",
    "yup": "^1.3.1"
  },
  "devDependencies": {
    "@graphql-codegen/cli": "^5.0.0",
    "@graphql-codegen/client-preset": "^4.1.0",
    "@netlify/plugin-nextjs": "^4.40.2",
    "@next/bundle-analyzer": "^13.4.19",
    "@parcel/watcher": "^2.3.0",
    "@tanstack/eslint-plugin-query": "^4.32.5",
    "@types/node": "20.5.6",
    "@types/react": "18.2.21",
    "@types/react-dom": "18.2.7",
    "eslint": "8.48.0",
    "eslint-config-next": "13.4.19",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.0",
    "eslint-plugin-tss-unused-classes": "^1.0.2",
    "eslint-plugin-unused-imports": "^3.0.0",
    "husky": "^8.0.3",
    "i18next-parser": "^8.7.0",
    "lint-staged": "^14.0.1",
    "next-translate-plugin": "^2.6.0",
    "prettier": "^3.0.2",
    "ts-node": "^10.9.1",
    "typescript": "^5.1.6"
  }
}

I deployed 2 different instances of the same app but the only difference is the Next.js package version

next@13.4.19 https://clinquant-toffee-dd9fbb.netlify.app/_next/data/Rr8b-MD6nIel6rAm3sYMI/en/login.json

next@13.4.12 https://va-9486.netlify.app/_next/data/Vm5YUudki4TmjFU9mI3oN/en/login.json

those links are supposed to be the JSON file for the login page that uses getServerSideProps.

based on the logs those JSON files are servers from /.netlify/functions/___netlify-handler through a redirect

6:25:18 PM:   {
6:25:18 PM:     from: "/_next/data/Vm5YUudki4TmjFU9mI3oN/en/login.json",
6:25:18 PM:     to: "/.netlify/functions/___netlify-handler",
6:25:18 PM:     status: 200,
6:25:18 PM:     force: false
6:25:18 PM:   },
9:05:00 AM:   {
9:05:00 AM:     from: "/_next/data/Rr8b-MD6nIel6rAm3sYMI/en/login.json",
9:05:00 AM:     to: "/.netlify/functions/___netlify-handler",
9:05:00 AM:     status: 200,
9:05:00 AM:     force: false
9:05:00 AM:   },

so apparently this issue is ___netlify-handler which generated by @netlify/plugin-nextjs for Next js v13.4.13 and above.

Since the issue exists on the plugin’s repo, the devs will check and follow-up when they can.

Any insights about when this will be fixed?

there is a new version of next-runtime package was published to address some issues, but those fixes are only applied to Nextjs v13.5 and they are mentioned in this GitHub issue “run our requireHooks when Next version is 13.3.x-13.4.9” which means superior versions then 13.4.9 will not be supported.

if that is the case at least we should have some sort of information about next-runtime package and what versions it supports.

It’ll be fixed eventually. There’s no concrete timeline to share yet.