Skip to content

feat: add env:*#2110

Merged
atilafassina merged 10 commits intomainfrom
feat-runtime-env
Mar 26, 2026
Merged

feat: add env:*#2110
atilafassina merged 10 commits intomainfrom
feat-runtime-env

Conversation

@lxsmnsyc
Copy link
Copy Markdown
Member

@lxsmnsyc lxsmnsyc commented Mar 16, 2026

This PR adds the env:server and env:client modules

// Loads SERVER_* from .env
// Throws and omits all detected variables on client runtime
import { SERVER_EXAMPLE } from 'env:server';

console.log(SERVER_EXAMPLE);

// Loads CLIENT_* from .env
import { CLIENT_EXAMPLE } from 'env:client';

console.log(CLIENT_EXAMPLE);

// Dynamically loads environment variables (only on server)
import env from 'env:server/runtime';

console.log(env.NODE_ENV);

closes #2113

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: eeb2093

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 16, 2026

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit eeb2093
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/69c55fcb4cf1bc0008ad0d0e
😎 Deploy Preview https://deploy-preview-2110--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 16, 2026

Open in StackBlitz

npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2110
npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2110

commit: eeb2093

Copy link
Copy Markdown
Member

@atilafassina atilafassina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before merging this one, let's make sure we have some tests.
specially assuring that there's no way secrets can leak

@atilafassina atilafassina enabled auto-merge (squash) March 26, 2026 16:30
@atilafassina atilafassina merged commit b9c4ade into main Mar 26, 2026
10 checks passed
@atilafassina atilafassina deleted the feat-runtime-env branch March 26, 2026 16:34
@eru123
Copy link
Copy Markdown

eru123 commented Mar 26, 2026

Nice, this is a great feat, ensuring server and client env is loaded differently!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: 2.0.0-alpha.2 - process.env not available in server functions

5 participants