redwoodjs / redwood-tutorial

The end state after completing the RedwoodJS introduction tutorial
https://redwoodjs.com/tutorial
40 stars 109 forks source link

MSW isn't enabled for Storybook #19

Closed realStandal closed 2 years ago

realStandal commented 2 years ago

Steps to Reproduce

1 - git clone https://github.com/redwoodjs/redwood-tutorial.git 2 - cd redwood-tutorial 3 - yarn install 4 - yarn rw sb

Open your browser's developer tools -> console, notice the lack of a "[MSW] Mocking enabled." message.

Explanation

It seems the MSW isn't getting started when Storybook is, so queries and mutations aren't mocked.

What I'm expecting (taken from another Redwood app):

image

What I'm seeing:

msw not started

All cells will stay in the loading state, with no other error.

You can see another example of this here, in @Kritsatorn's fork - he's also the original one who encountered this.


I've seen/heard the tutorial (app) is getting rewritten for v1, not sure how that fits in with this issue (or if it's true).

thedavidprice commented 2 years ago

@realStandal I cannot reproduce this error on my MacOS system. Also, I did just update the repo to v0.45.0 as there was a Windows server bug in 0.44.1

Could you try v0.45.0 and see if this issue persists? If so, it would also be helpful to validate on a fresh install of create-redwood-app.

If anything is broken here, this should be escalated to the main repo as a Storybook bug on Windows. TBD

realStandal commented 2 years ago

Hmm, @Kritsatorn are you on Windows as well?

I certainly can and will @thedavidprice. I didn't test a fresh app but was able to update another app to 0.44.1 and run Storybook without incident from it.

That led me to opening the issue here, from what I've seen it's segregated to the tutorial app.

realStandal commented 2 years ago

The MSW still isn't getting enabled for me, I'll test on a fresh app.

image

realStandal commented 2 years ago

@thedavidprice Great call on the testing with a fresh app, doesn't look like it's getting enabled in one of them either.

I'll close and relocate this to the main repo 👍

thedavidprice commented 2 years ago

@realStandal Well, that was my concern but really grateful for the help diagnosing so we can escalate.

When you open the Issue:

  1. could you include exact steps to reproduce (and/or even better an example repo to clone)
  2. do include your yarn rw info

yay/boo

Kritsatorn commented 2 years ago

I am using MacOS on intel Steps to reproduce

  1. git clone https://github.com/redwoodjs/redwood-tutorial.git
  2. cd redwood-tutorial
  3. yarn install
  4. yarn rw sb
  5. yarn rw g cell comments
  6. Add the CommentsCell to Article Component

the result is

Screen Shot 2565-02-12 at 08 56 45

and It is not what the tutorial said, It should be using mock data of that cell on storybook but It's always getting loading.

thedavidprice commented 2 years ago

Thank you @Kritsatorn

We've moved this Issue over here in order to prioritize: https://github.com/redwoodjs/redwood/issues/4450

Could you please add this comment there?

Kritsatorn commented 2 years ago

OK sure

cannikin commented 2 years ago

This could be related to catching us in the middle of a version update...we just updated Part 1 of the tutorial to with the v1.0 release candidates of Redwood. We also updated the redwood-tutorial repo to the latest version. However Part 2 is still being worked on. Depending on when that repo was checked out you might have caught it in a slightly in-between state!

As I'm going through Part 2 all the cell mocking and MSW stuff is working fine for me (macOS).

realStandal commented 2 years ago

Hey @cannikin I believe this issue to be outstanding to the framework, not just tutorial app. We've reopened the issue on the framework repository. It's occuring even for a new create redwood-app.

Peculiar it's working for some on MacOS, then others not (Kritstorn).