Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APP] Regression in frontend when initializing Backbone #27

Closed
willroberts opened this issue Sep 10, 2022 · 2 comments · Fixed by #31
Closed

[APP] Regression in frontend when initializing Backbone #27

willroberts opened this issue Sep 10, 2022 · 2 comments · Fixed by #31
Assignees
Labels
bug Something isn't working

Comments

@willroberts
Copy link
Collaborator

willroberts commented Sep 10, 2022

Description

There are client errors preventing us from reaching the main menu. Based on checking out one commit at a time and rebuilding, I believe this started happening in 63cc664 (Part of linting changes in #24 .

The old description below was resolved in #30

Old Description (process.env.FIREBASE_URL issue)

In c4d3352, just before #15 was merged, the app will start as expected when accessing http://localhost:3000 after running docker compose up. This is because despite process.env being empty, the following code succeeds:

# app/application.coffee
Firebase = window.Firebase = require 'firebase'
minBrowserVersionRef = new Firebase(process.env.FIREBASE_URL).child("system-status").child('browsers')

After #15, this results in an error when loading the client:

Unhandled rejection Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com 
@willroberts willroberts added the bug Something isn't working label Sep 10, 2022
@willroberts willroberts self-assigned this Sep 10, 2022
@willroberts
Copy link
Collaborator Author

willroberts commented Sep 10, 2022

Looks like this is related to yarn build:app, which expects FIREBASE_URL to be available as an environment variable when called. In the short term, we can instead run FIREBASE_URL=<my-firebase-url> yarn build:app, but we may want to further improve the ergonomics around envify.

Edit: This is specifically caused by the removal of the default Firebase URL in config/development.json, which was previously set to https://duelyst-development.firebaseio.com/.

@willroberts
Copy link
Collaborator Author

willroberts commented Sep 10, 2022

Resolving the above reveals another error:

server_status_manager.js:32 Uncaught TypeError: DuelystFirebase.Model is not a constructor

Looking into Backbone.js to investigate:

@willroberts willroberts changed the title [APP] Regression in frontend when accessing process.env.FIREBASE_URL [APP] Regression in frontend when using Backbone.Firebase Sep 13, 2022
@willroberts willroberts changed the title [APP] Regression in frontend when using Backbone.Firebase [APP] Regression in frontend when using Backbone Sep 13, 2022
@willroberts willroberts changed the title [APP] Regression in frontend when using Backbone [APP] Regression in frontend when initializing Backbone Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant