Skip to content

Unexpected References to Server Actions, Turbopack, Hot Reload and DevTools in Production Export Build #76198

Open
@daniilpanichevornament

Description

Link to the code that reproduces this issue

https://github.com/daniilpanichevornament/next-export

To Reproduce

  1. Configure Next.js with the module: export option.
  2. Run the production build.
  3. Inspect the output source files for references to server actions, turbopack, hot reload, and devtools

Additional Evidence:

I have identified these issues in the built files:

Current vs. Expected behavior

Expected Behavior:

A production export build should include only the necessary static content without any references to development or server-only features, resulting in an optimized bundle.

Actual Behavior:

The build output contains references to server actions and various development tools, leading to a larger bundle size and unnecessary traffic overhead.

Impact:

This issue might be affecting performance in production, especially under high load, due to the increased bundle size and the overhead of shipping unused code.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
  Available memory (MB): 16111
  Available CPU cores: 16
Binaries:
  Node: 20.11.1
  npm: 10.2.4
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.1.7 // Latest available version is detected (15.1.7).
  eslint-config-next: 15.1.7
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: export

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

Performance, Turbopack, Server Actions, Output

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

next build (local)

Additional context

I assume that the static export should be completely free of code that isn't used in production.
Any insights on whether this is expected behavior or if there's a configuration option to remove these references would be greatly appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    OutputRelated to the the output configuration option.linear: nextConfirmed issue that is tracked by the Next.js team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions