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

RAZZLE_PUBLIC_URL is overridden by server.jsx code #6119

Open
ichim-david opened this issue Jun 22, 2024 · 1 comment
Open

RAZZLE_PUBLIC_URL is overridden by server.jsx code #6119

ichim-david opened this issue Jun 22, 2024 · 1 comment

Comments

@ichim-david
Copy link
Sponsor Member

Describe the bug
Volto should use the razzle env for setting publicURL

To Reproduce
Steps to reproduce the behavior:
Start Volto with:
RAZZLE_PUBLIC_URL=http://backend:8080/SITE pnpm start
inspect within the browser devtools:
window.env.publicURL
locally you will see it being http://localhost:3000 instead of http://backend:8080/SITE

Expected behavior

  1. Remove
    https://github.com/plone/volto/blob/main/packages/volto/src/server.jsx#L162
    Since we define config.settings.publicURL
    https://github.com/plone/volto/blob/main/packages/volto/src/config/index.js#L57

  2. use only config.settings.publicURL here
    https://github.com/plone/volto/blob/main/packages/volto/src/server.jsx#L293

@davisagli
Copy link
Sponsor Member

@ichim-david It makes sense to me that RAZZLE_PUBLIC_URL should take precedence if it was set. But let's not remove using res.locals.detectedHost -- that's important if RAZZLE_PUBLIC_URL was not set.

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

No branches or pull requests

2 participants