kentcdodds / testing-workshop

A workshop for learning how to test JavaScript applications
http://git.io/testing-workshop
1.36k stars 707 forks source link

Launch app without any articles and tags #27

Closed fengcj closed 7 years ago

fengcj commented 7 years ago

Environment info:

Problem description:

1) run npm start dev without any error 2) launch http://localhost:8080/#/ successfully, but the content of the website is as below:

Image of Screen https://github.com/fengcj/weewikipaint/blob/master/screen.png

3) check the response of /api/articles?limit=10&offset=0 as below: {"articles":[],"articlesCount":0}

I guess this might be the DB issue.

@kentcdodds , please give me some suggestion.

kentcdodds commented 7 years ago

This is because you have a malformed JWT in your local storage. If you remove that it'll work fine.

We should probably fix the app so it removes it for you in that case. Would you like to do that? 😀

fengcj commented 7 years ago

@kentcdodds , thanks for quick reply. How can I remove my malformed JWT?

kentcdodds commented 7 years ago

Sorry, I'm on mobile, but Google how to access local storage for your browser in the dev tools.

fengcj commented 7 years ago

if you mean remove malformed JWT is clear local storage in the browser, I had done that, but still not working. @kentcdodds , please feel free to do you own job first. I can wait when you have the time to solve this issue. Thank you again.

kentcdodds commented 7 years ago

I believe I've resolved the issue. You should be able to just do a git pull and get the updated (working hopefully?) app 👍

fengcj commented 7 years ago

@kentcdodds , now it works as expected. great job!

wyattsweet commented 7 years ago

@kentcdodds so far I'm loving the course! I just pulled down master and went through the setup. When I run yarn start dev my app is also loading without any articles or tags. In the dev tools there is nothing in Application > Local Storage to remove and I'm not seeing any errors...I'm running –

Any idea what might be going on?

kentcdodds commented 7 years ago

Could be that your load-database script failed. Try this:

node ./scripts/load-database
wyattsweet commented 7 years ago

The problem was I was trying to run this from my Dropbox folder. Once I moved it over to a different directory everything built perfectly. Thanks for the assistance @kentcdodds!

kentcdodds commented 7 years ago

Ah, yeah, putting npm-based projects in dropbox is probably not advisable considering how HUGE the node_modules directory can be 😅

kentcdodds commented 7 years ago

Glad you got it working!