Skip to content

Large unused dependencies added to standalone output #58160

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

Closed
1 task done
robpc opened this issue Nov 8, 2023 · 2 comments
Closed
1 task done

Large unused dependencies added to standalone output #58160

robpc opened this issue Nov 8, 2023 · 2 comments
Labels
bug Issue was opened via the bug report template. Output Related to the the output configuration option. stale The issue has not seen recent activity.

Comments

@robpc
Copy link

robpc commented Nov 8, 2023

Link to the code that reproduces this issue

https://github.com/robpc/nextjs-standalone-storybook-test

To Reproduce

Create the project

npx create-next-app@latest nextjs-standalone-storybook-test
cd nextjs-standalone-storybook-test/

Edit the next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
    output: 'standalone'
}

module.exports = nextConfig

Test the standalone build

$ npm run build
# ...
$ du -sh .next/standalone/node_modules/
23M     .next/standalone/node_modules/

Add storybook

npx storybook@latest init

Retest the standalone build

$ npm run build
# ...
$ du -sh .next/standalone/node_modules/
145M    .next/standalone/node_modules/

Current vs. Expected behavior

Since storybook adds no dependencies used in app/, the expectation is that the output would be the same as the build without storybook. In other examples this was observed to be much larger (ex 400mb). This issue is similar to #51029

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
Binaries:
  Node: 18.16.0
  npm: 9.5.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.1
  eslint-config-next: 14.0.1
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: standalone

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

Standalone mode (output: "standalone")

Additional context

No response

@robpc robpc added the bug Issue was opened via the bug report template. label Nov 8, 2023
@github-actions github-actions bot added the Output Related to the the output configuration option. label Nov 8, 2023
@robpc robpc changed the title Large unused dependences to standalone output Large unused dependences added to standalone output Nov 8, 2023
@robpc robpc changed the title Large unused dependences added to standalone output Large unused dependencies added to standalone output Nov 8, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label May 6, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Output Related to the the output configuration option. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants