"window is not defined" error when signed in
fromonesource opened this issue · comments
Describe the Bug
When I go directly to https://myviewtu.be/watch?v=DeR17AlTNQg I get the error "window is not defined". If I navigate to the homepage and then back, the error is gone and the video loads fine.
Steps to Reproduce the Bug
- Sign into a local viewtube user account
- Go to https://yourviewtu.be/watch?v=DeR17AlTNQg
- See the error
Expected Behaviour
Video loads and plays
Screenshot/Screen recording
![image](https://private-user-images.githubusercontent.com/3075132/274452243-55489f09-04c1-4b02-af7f-975b99a8c23b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDQ4MDUxMTUsIm5iZiI6MTcwNDgwNDgxNSwicGF0aCI6Ii8zMDc1MTMyLzI3NDQ1MjI0My01NTQ4OWYwOS0wNGMxLTRiMDItYWY3Zi05NzViOTlhOGMyM2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDEwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAxMDlUMTI1MzM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjcxNTUwMzQ4YTVhNGNjNTZiZjRlZTMyZmE1YjYwNTM2YzNkZDBhMzRkYTNiMjM4ZjQyMjBmZmVhNGY3MzhiMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.gdXfa0eT85nuc2jaIRemq4jzx_RQOzbAb3yf-DP0tWY)
Device Info
- Browser: Brave
- Version: 1.58.137
Additional Context
Hi!
I get the exact same error whenever I open a video on a new tab/window of the browser.
I guess something goes wrong when you are not coming from the homepage.
I can't seem to be able to reproduce this, is it still ocurring?
I have just pulled from development and tried again:
- on Edge (Chromium): no issues.
- on Firefox: I get the "window is not defined" whenever: I open a link in a new tab or window; I copy/paste the URL on a new tab; I refresh the page.
In the console and the logs I don't see any difference from when I use Firefox or Edge 🤷:
- Console:
![image](https://private-user-images.githubusercontent.com/1062125/285408922-50182db2-2aa9-4d5c-a33e-9d5d8d55d5f0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDQ4MDUxMTUsIm5iZiI6MTcwNDgwNDgxNSwicGF0aCI6Ii8xMDYyMTI1LzI4NTQwODkyMi01MDE4MmRiMi0yYWE5LTRkNWMtYTMzZS05ZDVkOGQ1NWQ1ZjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDEwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAxMDlUMTI1MzM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDY1YmE1YTU0ODhiODdkZjcwMGIwYTNjNGIzMGJmYWJlYjA5ZTVjMjkyMzdjZTEzYmRhOTRhNmUyNDM3ZGNhMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.l9aki-zoAq8PGuDAVrEC6EV2oUo423LVwWOm5N_DRC8)
- Logs:
Nov 24 08:56:09 XYZ pnpm[2004]: using nestApp.inject for /api/videos/2oWbDCql4JA external: undefined Nov 24 08:56:09 XYZ pnpm[2004]: using nestApp.inject for /api/videos/2oWbDCql4JA external: undefined
I have the same error on ipad safari.
when i'm logged in, click subscriptions and then click on a video. Somehow it loads but nothing happens, if i refresh the site I get "windownis not defined".
It does not happen everytime.
I've also come across this issue in Chrome, when attempting to set up URL redirecting.
I have resolved the issue in the referenced pull request. If there are still problems with this, please @ me or open an issue