Hi everyone!
I made sure to look around other threads here, got a few pointers from StackOverflow, and in general googled my way around, but didn't find anything specific enough regarding the issues I'm going to share here.
I just want to have a local deploy of the Notes App from #react-basics in order to then customize it a little, push it to GitHub and make it part of my portfolio. I just downloaded the code as seen here, which was working on the scrim (but do notice that, upon clicking on refresh and trying to edit anything it gives pretty much the same error you will see on my attached screenshots): https://scrimba.com/learn/frontend/debouncing-updates-part-3-co3224f249bca482bd4d12690?a=14540.0.8.L22_20
I've seen some references to previous issues with VS Code and local envs, but those seem to have happened with Webpack and I'm running Vite, as the updated course instructs.
Now, after running npm run dev and navigating to my localhost address I can see the initial screen of the app but it quickly blanks out and the browser's dev console throws out a bunch of errors as seen on the attached images.
So it all seems to start breaking down from App.jsx line 52 which is the if() on the following useEffect hook:
useEffect(() => { const timeoutId = setTimeout(() => { if (tempNoteText !== currentNote.body) { updateNote(tempNoteText) } }, 500) return () => clearTimeout(timeoutId) }, [tempNoteText])
That missing currentNote object comes from:
const currentNote = notes.find(note => note.id === currentNoteId) || notes[0]
Which in turn calls out state variable const [notes, setNotes] = useState([])
It is all in the scrim linked above for more reference, but anyway I wonder if this has anything to do with Firebase? Curiously enough, both my localhost tab AND the Scrimba tab where I had the scrim open would randomly crash as well when trying to refresh my local deploy.
Thanks!