codesandbox / codesandbox/codesandbox-client

Why 'process.env' don't work when packaging

Open
#8,803 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

When I execute yarn build:sandpack
the value in process.env is always empty and the global variables .env do not work at all.

Is there something wrong with my execution?

Image

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the issue with yarn build:sandpack and compare the packaged result with the expected process.env and .env behavior shown in the report. The issue does not name a file or test, so first locate the Sandpack build entry point and identify how environment values are handled; done when the expected environment behavior is confirmed and covered by an appropriate check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.