Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting NEXT_PRIVATE_DEBUG_CACHE as Empty Value in .env.local Causes Error #859

Open
richg0ld opened this issue Nov 8, 2024 · 0 comments
Labels
bug Something isn't working next15 Waiting for Next.js 15

Comments

@richg0ld
Copy link

richg0ld commented Nov 8, 2024

Brief Description of the Bug
When setting NEXT_PRIVATE_DEBUG_CACHE= as an empty value in the .env.local file, an error occurs. This issue arises despite the environment variable being defined.

Severity
Minor

Frequency of Occurrence
Always

Steps to Reproduce
Provide detailed steps to reproduce the behavior, including any specific conditions or configurations where the bug occurs:

  1. Add NEXT_PRIVATE_DEBUG_CACHE= to the .env.local file without assigning any value.
  2. Start the Next.js server.
  3. Observe the error that appears on the console or during the application startup.

Expected vs. Actual Behavior
Expected: The Next.js application should start normally, recognizing the environment variable even if it’s left empty.
Actual: An error occurs, preventing the application from starting or causing unexpected behavior due to the empty environment variable.

Screenshots/Logs

Environment:

  • OS: MacOS
  • Node.js version: 20.12.2
  • @neshca/cache-handler version: 1.8.1
  • next version: 15.0.2

Dependencies and Versions

Attempted Solutions or Workarounds
To make it work, the NEXT_PRIVATE_DEBUG_CACHE variable needs to be removed entirely.

It seems that the issue lies with the code typeof process.env.NEXT_PRIVATE_DEBUG_CACHE !== 'undefined'.

When NEXT_PRIVATE_DEBUG_CACHE= is declared with an empty value, it is recognized as an empty string "" instead of undefined, so this code needs to be adjusted accordingly.

Impact of the Bug
I'm having issues managing the variables used in the .env file.

Additional context

@richg0ld richg0ld added the bug Something isn't working label Nov 8, 2024
@better-salmon better-salmon added the next15 Waiting for Next.js 15 label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next15 Waiting for Next.js 15
Projects
None yet
Development

No branches or pull requests

2 participants