Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/error from Pages Router is being bundled with App Router #76592

Open
AnYiEE opened this issue Feb 27, 2025 · 3 comments
Open

/error from Pages Router is being bundled with App Router #76592

AnYiEE opened this issue Feb 27, 2025 · 3 comments
Labels
Error Handling Related to handling errors (e.g., error.tsx, global-error.tsx). Pages Router Related to Pages Router.

Comments

@AnYiEE
Copy link

AnYiEE commented Feb 27, 2025

Link to the code that reproduces this issue

https://github.com/AnYiEE/touhou-mystia-izakaya-assistant

To Reproduce

  1. Clone the repository
  2. Execute pnpm add @next/bundle-analyzer
  3. Modify next.config.ts to import Analyzer
  4. Create a .env.local file and write SELF_HOSTED=true in it
  5. Execute pnpm build
  6. See output .next/analyze/client.html

Current vs. Expected behavior

From the image, it can be seen that react-dom-client.production.js and react-dom.production.js are bundled, with the former being version 19.1.0-rc, while my app uses 18.3.1, which is the latter.

Is this a bug? Or is Next.js 15 not fully compatible with React 18? (I remember Next.js 14 didn't have this issue).

Image

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65410
  Available CPU cores: 12
Binaries:
  Node: 22.14.0
  npm: 11.1.0
  Yarn: N/A
  pnpm: 10.5.2
Relevant Packages:
  next: 15.2.0
  eslint-config-next: 15.2.0
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.7.3
Next.js Config:
  output: N/A

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

Output, Performance

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

next build (local)

Additional context

File generated by the Analyzer (extension needs to be changed back)

client.html.txt

@github-actions github-actions bot added Output Related to the the output configuration option. Performance Anything with regards to Next.js performance. labels Feb 27, 2025
@AnYiEE
Copy link
Author

AnYiEE commented Feb 28, 2025

And the output bundled with v15.2.0 is approximately 12kb larger than that of v15.1.7. (form cli log massage, shared js, 106kb before, 118kb after)

@samcx
Copy link
Member

samcx commented Feb 28, 2025

@AnYiEE Thank you for submitting an issue!

We are taking a look—

@samcx samcx removed Output Related to the the output configuration option. Performance Anything with regards to Next.js performance. labels Feb 28, 2025
@samcx samcx added Error Handling Related to handling errors (e.g., error.tsx, global-error.tsx). Pages Router Related to Pages Router. labels Mar 3, 2025
@samcx samcx changed the title [BUG] Next.js 15 bundled duplicate React packages /error from Pages Router is being bundled with App Router Mar 3, 2025
@samcx
Copy link
Member

samcx commented Mar 3, 2025

@AnYiEE I've updated the title to reflect what's going on here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Handling Related to handling errors (e.g., error.tsx, global-error.tsx). Pages Router Related to Pages Router.
Projects
None yet
Development

No branches or pull requests

2 participants