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

The server-only environment variable can not be loaded if concurrentFeatures: true #30891

Closed
kjj6198 opened this issue Nov 3, 2021 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@kjj6198
Copy link

kjj6198 commented Nov 3, 2021

What version of Next.js are you using?

latest (12.0.2)

What version of Node.js are you using?

14.16.0

What browser are you using?

Edge

What operating system are you using?

macOS

How are you deploying your application?

next dev

Describe the Bug

I'm using next.js environment variables example as an example. When I upgrade react to 18 (alpha) and enable the concurrentFeatures: true, the environment variables become undefined.

截圖 2021-11-03 下午10 45 40

However, public variable can be read.

public

Expected Behavior

The blog post and docs seems not describing this behavior, so I expected the env variables should be loaded correctly.

To Reproduce

Repo can be found here.

  1. define env variable in .env
  2. enable concurrentFeatures: true
  3. restart the dev server and observe the console output
@kjj6198 kjj6198 added the bug Issue was opened via the bug report template. label Nov 3, 2021
@kjj6198 kjj6198 changed the title The server-only environment variable can not loaded if concurrentFeatures: true The server-only environment variable can not be loaded if concurrentFeatures: true Nov 4, 2021
@shuding shuding added this to To do in React Server Components in Next.js (Alpha) via automation Nov 4, 2021
@huozhi
Copy link
Member

huozhi commented Dec 25, 2021

Looks like it's fixed in #31261, it works in latest next.js now could you please try again? 🙏

@huozhi huozhi closed this as completed Dec 25, 2021
React Server Components in Next.js (Alpha) automation moved this from To do to Done Dec 25, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
No open projects
Development

No branches or pull requests

4 participants