Skip to content

[BUG] env is not accessible writing inline #231

Closed
@j4tmr

Description

@j4tmr

Describe the bug

export const api = createApiClient({ endpoint: process.env.API_URL! });
not able to get process.env.API_URL

export const createApi = () => createApiClient({ endpoint: process.env.API_URL! });
able to get

Steps to reproduce

simple as write

Expected behavior

get env both

@opennextjs/cloudflare version

0.3.4

Wrangler version

3.100.0

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10
Binaries:
  Node: 20.10.0
  npm: 10.9.2
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 15.1.4 // Latest available version is detected (15.1.4).
  eslint-config-next: 15.1.4
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions