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

After an error fix, it'll load the first story #614

Closed
arunoda opened this issue Nov 10, 2016 · 6 comments
Closed

After an error fix, it'll load the first story #614

arunoda opened this issue Nov 10, 2016 · 6 comments
Assignees
Labels

Comments

@arunoda
Copy link
Member

arunoda commented Nov 10, 2016

If there's a syntax error, it should show the webpack error overlay.
After that, it should reload the preview and load the current story.

But now, it'll load the first story in the storybook instead.

Reason

After an error, it'll reload the page. Then it'll load the very first story since that is hard coded on the iframe URL. We need to change it and reload.

@tmeasday
Copy link
Member

This one is really annoying me right now. Will take a look.

@tmeasday
Copy link
Member

Does anyone have a reproduction for this? I can't make it happen RN

@tmeasday
Copy link
Member

tmeasday commented Nov 22, 2017

This is actually easy to reproduce. Follow these steps carefully (tested on current release/3.3):

  1. Load the cra-kitchen-sink storybook
  2. Browse to http://localhost:9010/ (that exact path).
  3. Browse to a different story (not the welcome story).
  • Notice that the main URL will change
  • Also notice the iframe URL will not change.
  1. Add throw new Error("foo"); somewhere in some story file at the top level, allow HMR
  • Notice the error show in a red box in the preview iframe (sometimes?)
  1. Remove the error, allow HMR
  • Notice the welcome story is rendered in the iframe, even though the main URL is still the URL for the other story.
  1. Hit refresh
  • Notice the correct story now loads in the iframe
  • Also notice the iframe URL is now in sync with the main URL.

Note if you are going to continue you have to start again at step 1, not continue on from step 6, as the iframe URL will have changed.

tmeasday added a commit that referenced this issue Nov 22, 2017
Sometimes when there are problems with HMR, we end up doing a
hard-reload of the preview iframe, whilst leaving the main window.

As the preview iframe didn't change its URL ever, this led to problems
where the old (usually original) story was loaded in such circumstances.

See #614 and #1328
@tmeasday
Copy link
Member

See #2349

@stale
Copy link

stale bot commented Jan 6, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!

@stale stale bot added the inactive label Jan 6, 2018
@tmeasday
Copy link
Member

tmeasday commented Jan 6, 2018

This was fixed in 3.3.0

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

No branches or pull requests

3 participants