profile
viewpoint
Andy Mockler asmockler ISEE Cambridge, MA https://asmockler.github.io 👨🏻‍💻

asmockler/emoji-as-a-service 8

Predictable, hi-res emojis as a service

asmockler/habits 4

Simple habit tracking with React

asmockler/intention 4

:spiral_calendar: Actually plan your days by managing your events and todos on the same calendar.

asmockler/OCD 3

iOS Application for Brook Alius' 2015 BFA Final Show

asmockler/notfinished 2

Calendar + tasks

asmockler/parcel-code-split 2

Examples of code splitting with Parcel

asmockler/acorn 1

A small, fast, JavaScript-based JavaScript parser

asmockler/condense-number 1

Locale-aware number condensing

push eventveryfunco/drew-tekulve

Andy Mockler

commit sha 9cd1d76d48d7764f0460d7d9d0781327b5d2826c

Use resend

view details

push time in 4 days

startedFHIR/fhir.js

started time in a month

issue openedvercel/next.js

Environment variable behavior changed on 13.4.13-canary

Verify canary release

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

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.18.0
      npm: 8.19.2
      Yarn: 1.22.19
      pnpm: N/A
    Relevant Packages:
      next: 13.4.13-canary.14
      eslint-config-next: 13.4.12
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: standalone

Which area(s) of Next.js are affected? (leave empty if unsure)

Standalone mode (output: "standalone")

Link to the code that reproduces this issue or a replay of the bug

https://github.com/asmockler/next-bug-runtime-env-vars

To Reproduce

Create a standalone app and try to access an environment variable set not-at-build-time.

console.log(process.env.TEST) will evaluate to undefined for both of the following commands:

node .next/standalone/server.js
TEST=present node .next/standalone/server.js

I would expect the first to be undefined and the second to be present

Describe the Bug

Environment variables are not accessible when set after build-time.

Expected Behavior

Environment variables should be accessible and able to be overridden at runtime.

Which browser are you using? (if relevant)

Server-side

How are you deploying your application? (if relevant)

Standalone w/ Docker on Google Cloud Run

created time in 2 months

create barnchasmockler/next-bug-runtime-env-vars

branch : main

created branch time in 2 months

created repositoryasmockler/next-bug-runtime-env-vars

Reproduction for runtime env vars bug on standalone next@canary

created time in 2 months

create barnchasmockler/runtime-env-vars-bug

branch : main

created branch time in 2 months

created repositoryasmockler/runtime-env-vars-bug

Reproduction of runtime environment variable bug on next@13.4.13-canary

created time in 2 months

startedflynneva/react-ros

started time in 2 months

startedfabian-hiller/valibot

started time in 2 months

issue commentvercel/next.js

route.ts files being executed during build

I am also having this issue.

In my case, it is making it difficult to initialize some packages (like twilio) because not all of my environment variables are available during the build step. So, these packages throw errors, even though the desired result is just that the code compiles to be run where those environment variables exist.

davecarlson

comment created time in 2 months

more