firebase / emulators-codelab

Apache License 2.0
46 stars 38 forks source link

Website not rendering #12

Closed Visible-Break closed 3 years ago

Visible-Break commented 3 years ago

Following along with both the text & video tutorials, when trying to view the webpage using the emulator the page throws a bunch of errors and does not render.

I encounter the same issue when running emulators:start on both the /codelab-initial-state/ and /codelab-final-state/ folders.

Capture

samtstern commented 3 years ago

@Visible-Break I'm not able to reproduce this. Here's what I did:

  1. Clone this repo
  2. cd codelab-final-state
  3. cd functions && npm install && cd ../
  4. firebase emulators:start
  5. Navigate to localhost:5000

And here's what I see:

Screen Shot 2021-01-19 at 3 00 51 PM
Visible-Break commented 3 years ago

Hi samtstern, thanks for the reply & trying to work with me on this.

So I started over again - started by navigating to the folder where I've been keeping my local version of the repo and deleting all files, as well as deleting my firebase project previously setup for this tutorial.

Then following along with the tutorial,

  1. checked the version of java on my machine - version 15.0.1
  2. checked the version of node on my machine - version 12.18.4
  3. created a new Firebase project (with Google Analytics disabled)
  4. enabled anonymous authentication
  5. git clone https://github.com/firebase/emulators-codelab.git
  6. cd emulators-codelab\codelab-final-state
  7. For some reason the && operation doesn't work for me in VSCode terminal, so I executed the package install as 3 steps: cd functions -> npm install -> cd .. [note that "requested 'node' version '10' doesn't match your global version '12' "]
  8. firebase emulators:start
  9. Java.exe window opens, navigating to localhost:5000 - website looks functional as you see as well.
  10. Returning to the tutorial instructions, closed emulators from terminal (ctrl+c) and closed Java.exe window.
  11. npm install firebase-tools
  12. checked the version of firebase available - version 9.2.1
  13. firebase login
  14. firebase use --add -> select dedicated Firebase project created earlier, entered "default" for alias to be used.
  15. firebase emulators:start --import=./seed
  16. Java.exe window opens, navigating to localhost:5000 - website still looks functional, now with seed data being accessed.
  17. close emulators from terminal (ctrl+c) and closed Java.exe window.
  18. cd into codelab-initial-state\functions
  19. npm install -> cd ..
  20. npm install firebase-tools -> firebase version 9.2.1 verified
  21. firebase login
  22. firebase use --add -> select dedicated Firebase project created earlier, entered "default" for alias to be used.
  23. firebase emulators:start --import=./seed
  24. Java.exe window opens, navigating to localhost:5000 - website still looks functional, however seed data is not available (because I didn't do the frontend-emulator connection step)

Well, I hate to admit it, but I can't recreate the issue I was having either, though I don't notice anything different that I'm doing today that I didn't do the first or second time before opening this issue.

Only thing I can think of is that I had just installed Java for the first time that day, so maybe there were some setup operations completed over the course of a few shut down / turn on cycles since then (?)

samtstern commented 3 years ago

@Visible-Break thank you for such a detailed follow up! I am glad it's working now.

Visible-Break commented 3 years ago

Is the firebase emulator meant to work in an incognito window?

Was hitting some cache annoyances (launching from initial-state folder was continuing to bring in some of the code from final-state), so I wanted to move to incognito mode but neither final-state nor initial-state will launch properly.

Funny enough, these errors look the same as what I was encountering when I first opened this issue, although that was in a standard Chrome tab.

EDIT... continuing on this, I abandoned using incognito windows and chose to clear my browser history from the past hour instead and now these errors are persisting even in standard Chrome windows again.

Capture

samtstern commented 3 years ago

@Visible-Break I think we have an issue in recent versions of firebase-tools that is causing this, see: https://github.com/firebase/firebase-tools/pull/3065

For now I'd say you should downgrade to firebase-tools 9.1.0 or so until we get the bug fix out. Closing this issue here as I think we're tracking it over there.

samtstern commented 3 years ago

@Visible-Break we released a new version of firebase-tools last night with a fix for this bug, so if you upgrade to the latest everything should work!