Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjax taylor
Full Stack JavaScript Techdegree Student 13,166 PointsThis wont work for me. Console throws error: recentSearches.forEach is not a function. (line 85) index.html
I don't have nodemon module installed in my textEditor, but it tried launching in workspace as well. neither work and both throw the same error: (index):85 Uncaught TypeError: recentSearches.forEach is not a function at window.onload ((index):85)
Tried clearing localStorage to no avail
4 Answers
Stephanie Franco
9,167 PointsI'm having the same issue. Steps to recreate:
- Click Launch Workspace
- Click "eye" icon to view index.html in browser
- Type a word in the search bar and hit "search"
- Word does not get written to page, and there's a console error saying "Uncaught TypeError: Cannot read property 'forEach' of undefined at window.onload ((index):60)"
Andrew Bankson
Front End Web Development Techdegree Student 8,625 PointsI'm having this same issue as well. As far as I can tell, I typed in all the same code that he did (so it's not the issue of those functions being undefined.) I've been messing around with it but cannot seem to find what's going wrong.
Here's a snapshot of my code: https://w.trhou.se/xveolpx613
babyoscar
12,930 PointsI was having the same issue, in another question the problem was resolved by running localStorage.clear();
in the console, and it worked for me. You can try that. I hope this helped!
KRIS NIKOLAISEN
54,972 PointsI opened the video workspace and without searching see the error. The following functions need to be completed as they are empty initially:
function supportsLocalStorage() {
}
function getRecentSearches() {
}
function saveSearchString() {
}
function removeSearches() {
}
Here is a workspace with the code from the finished project
KRIS NIKOLAISEN
54,972 PointsKRIS NIKOLAISEN
54,972 PointsCan you post your code or a snapshot?