nextjs - 💡(How to fix) Fix Adding proxy causes requests to _next/data which return empty data [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#89768Fetched 2026-04-08 00:21:27
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2issue_type_added ×1referenced ×1

Error Message

These empty data files bring no value and may cause a client error if the app is rebuilt, even if assetPrefix with hash is used.

Code Example

Operating System:
  Platform: linux
  Arch: x64
  Version: #35~22.04.1-Ubuntu SMP Mon May 26 18:08:30 UTC 2025
  Available memory (MB): 7944
  Available CPU cores: 2
Binaries:
  Node: 24.11.1
  npm: 11.6.2
  Yarn: 1.22.22
  pnpm: 10.23.0
Relevant Packages:
  next: 16.1.6 // Latest available version is detected (16.1.6).
  eslint-config-next: 13.5.6
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/ari-party/repro-next-data-empty-object

To Reproduce

  1. Clone this repo
  2. npm install
  3. npm run build
  4. npm start
  5. Go to http://localhost:3000
  6. Open DevTools
  7. Go to the network tab
  8. Notice each additional _next/data request for each link to a page
  9. Open any of the requests
  10. View the response tab
  11. Empty JSON response {}

Current vs. Expected behavior

Current: Requests made to _next/data/*/*.json Expected: No requests made to _next/data/*/*.json These empty data files bring no value and may cause a client error if the app is rebuilt, even if assetPrefix with hash is used.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #35~22.04.1-Ubuntu SMP Mon May 26 18:08:30 UTC 2025
  Available memory (MB): 7944
  Available CPU cores: 2
Binaries:
  Node: 24.11.1
  npm: 11.6.2
  Yarn: 1.22.22
  pnpm: 10.23.0
Relevant Packages:
  next: 16.1.6 // Latest available version is detected (16.1.6).
  eslint-config-next: 13.5.6
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Middleware, Pages Router

Which stage(s) are affected? (Select all that apply)

next start (local)

Additional context

This a recreation of an older issue https://github.com/vercel/next.js/issues/59295. This issue is present for both the deprecated middleware and the newer proxy.

Additionally might be related: https://github.com/vercel/next.js/issues/59612

extent analysis

Problem Summary

Empty JSON response from _next/data/*/*.json requests

Root Cause Analysis

The issue is likely due to the way Next.js handles data fetching and caching.

Fix Plan

To fix this issue, you can use the getStaticProps method to pre-render pages and avoid making unnecessary data requests.

Step-by-Step Solution

  1. Update pages/_app.tsx:

import { AppProps } from 'next/app';

function MyApp({ Component, pageProps }: AppProps) { return <Component {...pageProps} />; }

export default MyApp;

2. **Update `pages/index.tsx`**:
   ```typescript
import { GetStaticProps } from 'next';

const HomePage = () => {
  // ...
};

export const getStaticProps: GetStaticProps = async () => {
  return {
    props: {}, // Return an empty object to avoid data requests
  };
};

export default HomePage;
  1. Update pages/posts.tsx:

import { GetStaticProps } from 'next';

const PostPage = () => { // ... };

export const getStaticProps: GetStaticProps = async () => { // Fetch data here and return it as props return { props: { // ... }, }; };

export default PostPage;

4. **Run `npm run build` and `npm start`** to see the changes.

### Verification
Check the network tab in DevTools to see if the `_next/data/*/*.json` requests are no longer being made.

### Extra Tips
* Make sure to update your `getStaticProps` methods to fetch and return data correctly.
* If you have a large number of pages, consider using a caching mechanism to improve performance.
* Refer to the Next.js documentation for more information on `getStaticProps` and data fetching.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Adding proxy causes requests to _next/data which return empty data [1 participants]