hubs icon indicating copy to clipboard operation
hubs copied to clipboard

Can't run hubs-cloud branch against my instance

Open leonardoazzi opened this issue 2 years ago • 9 comments

Description I've checkout to hubs-cloud branch after the latest release (september/22). When I run it, I'm getting a blank page and some errors when I access the home page or some room.

To Reproduce Steps to reproduce the behavior:

  1. Checkout and pull in the hubs-cloud branch
  2. Install with npm ci
  3. Do npm run login with your hubs-cloud instance
  4. Do npm start

Expected behavior Able to navigate the home page and rooms.

Screenshots image

image

Hardware

  • Device: Desktop
  • OS: Pop_OS 22.04
  • Browser: Firefox, Chrome

leonardoazzi avatar Sep 14 '22 12:09 leonardoazzi

Do you immediately get a white page? Myself and others have had such a problem before, if you have a similar one clearing your local storage could be the solution. Open dev tools > Application > Local Storage > Right click on the child element > Clear. Not a 100% sure this is your problem as well, but there is no bug harm in clearing this. It simply logs you out and stuff. You first check the contents of that child element if you want, before clearing it. Or you can first search for other messages on this "white page" error to check if it might be relecant in the first place.

NigelRidderhof avatar Sep 14 '22 14:09 NigelRidderhof

@leonardoazzi That first error (_react_components_styles_them_WEBPACK_IMPORTED_MODULE_0_.themes.find is not a function) looks suspicious, as if you have themes defined in your admin panel that are failing to be parsed. (This might also be the case if you cleared it to blank, because I think we might fail to fall-back to defaults in that case.)

If you copy/paste these default themes into the config in your admin panel, does that fix the problem? https://github.com/mozilla/hubs/blob/c53c2f17a7c5b2f1c7d0e1bbe019348c65a75cdc/themes.json

johnshaughnessy avatar Sep 14 '22 17:09 johnshaughnessy

Do you immediately get a white page? Myself and others have had such a problem before, if you have a similar one clearing your local storage could be the solution. Open dev tools > Application > Local Storage > Right click on the child element > Clear. Not a 100% sure this is your problem as well, but there is no bug harm in clearing this. It simply logs you out and stuff. You first check the contents of that child element if you want, before clearing it. Or you can first search for other messages on this "white page" error to check if it might be relecant in the first place.

Unfortunately this was not the issue. :( But that's an important tip. Thank you!

leonardoazzi avatar Sep 14 '22 18:09 leonardoazzi

@leonardoazzi That first error (_react_components_styles_them_WEBPACK_IMPORTED_MODULE_0_.themes.find is not a function) looks suspicious, as if you have themes defined in your admin panel that are failing to be parsed. (This might also be the case if you cleared it to blank, because I think we might fail to fall-back to defaults in that case.)

If you copy/paste these default themes into the config in your admin panel, does that fix the problem? https://github.com/mozilla/hubs/blob/c53c2f17a7c5b2f1c7d0e1bbe019348c65a75cdc/themes.json

Hey @johnshaughnessy ,

I supposed it could be something related, as it mentions the themes. I've changed the theme JSON to these, but there was no effect. image image

However, I've tested using the master branch, and it works just fine. Even with a slightly custom theme. image image

Could be this a bug in the release?

leonardoazzi avatar Sep 14 '22 18:09 leonardoazzi

It looks like the webpack-injected APP_CONFIG isn't loading correctly either.

The recent release included an upgrade to node LTS 16 and webpack 5. Could it be a tooling problem? (This wouldn't explain why it works on the latest master commites and not on the hubs-cloud branch, unless your master branch pointer isn't up-to-date.)

johnshaughnessy avatar Sep 14 '22 20:09 johnshaughnessy

I'm using Node v16.16.0, and webpack is now 5.74.0.

(This wouldn't explain why it works on the latest master commites and not on the hubs-cloud branch, unless your master branch pointer isn't up-to-date.)

I think it is up-to-date, I've checked on my gitk: image

leonardoazzi avatar Sep 14 '22 20:09 leonardoazzi

Does your terminal where you run the local server show something different / more than web console? Sometimes webpack errors show up becuase there is an additional compile error somewhere.

camelgod avatar Sep 15 '22 20:09 camelgod

Hi, @camelgod. I think there is nothing different in my console :c image

leonardoazzi avatar Sep 16 '22 12:09 leonardoazzi

The /src/utils/theme.js was not parsing the theme correctly in this version. It was trying to use .find() in a string, without parsing. I've solved locally as I report here: https://github.com/mozilla/hubs/commit/07ec12d60b7ee6cc3bb25c0369d7c7baad7f6a6d#r84387359

I don't know if it is a legit issue, so I'll leave to the Team to consider @johnshaughnessy @netpro2k xD

Thanks everyone for your help and attention!

leonardoazzi avatar Sep 19 '22 13:09 leonardoazzi