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

getEnv is not working on vercel edgeless function #388

Closed
himself65 opened this issue Jan 17, 2024 · 3 comments · Fixed by #395
Closed

getEnv is not working on vercel edgeless function #388

himself65 opened this issue Jan 17, 2024 · 3 comments · Fixed by #395
Assignees
Labels
bug Something isn't working

Comments

@himself65
Copy link
Contributor

himself65 commented Jan 17, 2024

https://github.com/himself65/waku-pokemon

I created a demo to connect backend database. And the 500 error on prod

https://waku-pokemon-p86nl519u-alex-yang.vercel.app/
image

I read the output file

function getEnv(key) {
  return globalThis.__WAKU_PRIVATE_ENV__[key];
}

image

image

__WAKU_PRIVATE_ENV__ is not defined in the output files

@himself65
Copy link
Contributor Author

yeah, reason is I used getEnv in the global context, but waku will set env map after you connect it

@himself65
Copy link
Contributor Author

himself65 commented Jan 17, 2024

See workaround: himself65/waku-pokemon#1

@dai-shi dai-shi added the bug Something isn't working label Jan 17, 2024
@dai-shi dai-shi self-assigned this Jan 17, 2024
@dai-shi dai-shi mentioned this issue Jan 17, 2024
83 tasks
@dai-shi
Copy link
Owner

dai-shi commented Jan 18, 2024

My hope is #395 fixes this. Can you please try it?

@dai-shi dai-shi linked a pull request Jan 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants