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

Server environment variables are reaching the client #185

Closed
krazyjakee opened this issue Oct 10, 2018 · 1 comment
Closed

Server environment variables are reaching the client #185

krazyjakee opened this issue Oct 10, 2018 · 1 comment

Comments

@krazyjakee
Copy link

Bug, Feature, or Question?

bug

Current Behavior

According the the razzle readme, having a envConfig file that serves the client and server differently should work but it doesn't.

Here @jaredpalmer suggested they would only be available if they were written into isomorphic code: jaredpalmer/razzle#528 (comment)

Desired Behavior

server-side variables should never reach the client.

Suggested Solutions

Perhaps either fix the isomorphic environment variables like razzle, or afterjs should provide it's own env-vars serialise function to separate client from server?

Additional Information

It could be related to this issue on the lack of tree-shaking as it potentially means those variables are reaching isomorphic javascript.

Here is a minimal example: https://github.com/krazyjakee/Afterjs-Sandbox/blob/environment-variables/src/Document.js#L42


  • After.js Version: 1.3.1
  • Razzle Version: 2.4.0
  • React Version: 16.5.1
  • OS: OSX High Sierra
  • Node Version: 10.10.0
  • Package Manager and Version: npm 6.4.1
@krazyjakee
Copy link
Author

Tree-shaking in razzle v3 solved this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant