Skip to content

fix(@next/env): respect loadEnvConfig cache per directory#92047

Open
raashish1601 wants to merge 1 commit intovercel:canaryfrom
raashish1601:contributor-66/nextjs-92040
Open

fix(@next/env): respect loadEnvConfig cache per directory#92047
raashish1601 wants to merge 1 commit intovercel:canaryfrom
raashish1601:contributor-66/nextjs-92040

Conversation

@raashish1601
Copy link
Copy Markdown

Fixes #92040.

Summary

  • reuse the cached @next/env result only when loadEnvConfig is called for the same resolved directory
  • reset the previous loaded-file list when switching directories so reload bookkeeping does not leak across roots
  • add a regression that loads two app roots back to back without orceReload

Testing

  • git diff --check
  • manual
    ode --experimental-strip-types harness against packages/next-env/index.ts covering process-env identity and two-directory reload behavior

@nextjs-bot
Copy link
Copy Markdown
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: 7332a4d

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@nextjs-bot
Copy link
Copy Markdown
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: 7332a4d

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loadEnvConfig silently ignores directory argument in monorepo due to internal cache

2 participants