Skip to content

Typescript(~20MB) present in build .next/standalone/node_modules when using standalone output #86981

@BlvckParrot

Description

@BlvckParrot

Link to the code that reproduces this issue

https://github.com/BlvckParrot/nextjs-issue-typescript-in-standalone-output

To Reproduce

  1. create new next app pnpx create-next-app@latest(with defaults)
  2. change output: "standalone" in next.config.ts
  3. run build pnpm build

Then see directory .next/standalone/node_modules/typescript

Current vs. Expected behavior

I would expected that in the .next/standalone/node_modules/typescript there would be no Typescript because it is not runtime dependency and it has a huge size.

Image

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 24.5.0
  npm: 11.5.1
  Yarn: 1.22.22
  pnpm: 9.15.9
Relevant Packages:
  next: 16.0.8 // Latest available version is detected (16.0.8).
  eslint-config-next: N/A
  react: 19.2.1
  react-dom: 19.2.1
  typescript: 5.9.3
Next.js Config:
  output: standalone

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

Turbopack

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

next build (local)

Additional context

I have tried this also with bun, deno, pnpm, npm, all with the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions