Storybook: Hash is being removed from iframe URL

Created on 25 Nov 2020  路  6Comments  路  Source: storybookjs/storybook

Most helpful comment

Sorry everybody for misleading. I checked again and found that:

Yes, the hash was stripping in 6.0 (6.0.28). But it did not affect our case because it was stripped a little bit after sroty initialization.

For example, if I open http://localhost:9999/iframe.html?id=components-button--basic#test with [email protected] and log window.location in the first line of the story, it is: http://localhost:9999/iframe.html?id=components-button--basic#test

With 6.1.0-rc.0 it logs: http://localhost:9999/iframe.html?id=components-button--basic&viewMode=story

All 6 comments

@Hypnosphi are you sure this wasn't in 6.0?

Maybe it was, but for some reason it didn't manifest itself in our case cc @andrey-skl

Sorry everybody for misleading. I checked again and found that:

Yes, the hash was stripping in 6.0 (6.0.28). But it did not affect our case because it was stripped a little bit after sroty initialization.

For example, if I open http://localhost:9999/iframe.html?id=components-button--basic#test with [email protected] and log window.location in the first line of the story, it is: http://localhost:9999/iframe.html?id=components-button--basic#test

With 6.1.0-rc.0 it logs: http://localhost:9999/iframe.html?id=components-button--basic&viewMode=story

Ahh, ok. My guess is the difference is the new loaders feature which adds an await into the story render process (awaiting nothing usually), which probably rearranges the execution of some code.

Huzzah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.8 containing PR #13308 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Closing this issue. Please re-open if you think there's still more to do.

@shilman @Hypnosphi thanks a lot for a quick fix, our case works perfect so far!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sakulstra picture sakulstra  路  3Comments

rpersaud picture rpersaud  路  3Comments

shilman picture shilman  路  3Comments

Jonovono picture Jonovono  路  3Comments

arunoda picture arunoda  路  3Comments