Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Standalone server.js does not default NODE_ENV to production

Open Beginner friendly
#3,444 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@reginaldalfret is already working on this.

Since Sep 25, 2026.

  • #3466 by @reginaldalfret — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active

Research direction

Start by running vinext build with output: "standalone", then inspect the generated dist/standalone/server.js and run it with node while NODE_ENV is unset. The work is done when the generated server defaults NODE_ENV to production before React is imported and the runtime no longer selects the development bundle.

Written by the indexing model from the issue text.

Description

Summary

The generated dist/standalone/server.js does not set NODE_ENV. If the variable is not set in the environment, react-dom/server selects its development bundle at runtime.

Repro

output: "standalone", vinext build, then node dist/standalone/server.js without NODE_ENV. react-dom/server resolves to its development build, which is slower and prints development-only warnings. Next.js's standalone server.js sets process.env.NODE_ENV = "production" itself.

Suggestion

Add process.env.NODE_ENV ??= "production" at the top of the generated server.js, before anything imports React.

Dominant language
TypeScript
Stars
9.2k
Forks
441
Avg merge
1d 7h
Merged PRs (30d)
412

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/vinext

All issues in cloudflare/vinext

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.