Skip to content

Conversation

@medihack
Copy link
Contributor

Closes #20068

What I did

Create channels URL dynamically on the client by using the window location object. I got rid of SERVER_CHANNEL_URL. I don't see a case where it is really needed anymore, but not sure about that.

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["bug"]

@g1r0
Copy link

g1r0 commented Apr 13, 2023

Just run into the server channel issue after upgrading to SB7.0.4. We are using it behind nginx proxies. Is it possible to opt out of using server channels at all? Thanks!

const channel = createPostMessageChannel({ page: 'preview' });
addons.setChannel(channel);

if (SERVER_CHANNEL_URL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I was worried that removing this if-statement might cause it to run more often, but it looks like it was always true already, because getServerChannelUrl always returns a non-empty string already.

@ndelangen ndelangen merged commit d760a5a into storybookjs:next Apr 20, 2023
@medihack medihack deleted the fix_client_channel_url branch April 20, 2023 12:05
@ndelangen ndelangen added the patch:yes Bugfix & documentation PR that need to be picked to main branch label May 23, 2023
@shilman shilman added patch:done Patch/release PRs already cherry-picked to main/release branch maintenance User-facing maintenance tasks and removed feature request labels May 23, 2023
shilman pushed a commit that referenced this pull request May 23, 2023
Create channel url on client from window.location
@shilman shilman mentioned this pull request May 23, 2023
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core maintenance User-facing maintenance tasks patch:done Patch/release PRs already cherry-picked to main/release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Hardcoded host for server channel url prevents usage of custom host

4 participants