-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Uncaught TypeError: Cannot read properties of null (reading 'postMessage') in Companion's Callback Endpoint #5334
Comments
Hi. does this also happen when you don't use stackblitz? (e.g. local development) i have a theory that it happens because in stackblitz the app runs inside of an |
@mifi yes it happens in local development, stackblitz and in production. I forgot to mention I am also using Cloudflare with DNS proxy |
ok thanks for clearing that up.
Where is Companion hosted? I don't know how your stackblitz can possibly work because it uses I think it could be related to #4107 |
also have you set a |
I can see that
from https://developer.mozilla.org/en-US/docs/Web/API/Window/opener |
|
Are the Uppy web-app static files hosted in nginx also (the configuration above)? If not, can you check whether the request to get the webapp HTML has a |
No they are hosted by Vercel, or locally in Nuxt3 Nitro server. example.com is a redaction. All headers were being sent. I think I solved it, the problem was the nuxt-security module I am using:
The stackblitz |
alright, so |
when window.opener == null #5334 (comment)
Yes that was the problem. I'll close the issue |
Initial checklist
Link to runnable example
https://stackblitz.com/edit/nuxt-starter-y4aec5
Steps to reproduce
https://example.com/companion/connect/googledrive/callback?
)https://example.com/companion/drive/send-token?uppyAuthToken=long-token-here
) does not close and returns the error.Setup:
My nuxt-starter stackblitz includes my nginx, companion pm2 script and companion.json options (which seems to break CORS, so I fallback to the env variable options). I also tested with Uppy Dashboard starter with the same errors.
Causes I've investigated:
COMPANION_CLIENT_ORIGINS
so that the targetOrigin for postMessage calls are available in the context of OAuth.https://example.com/companion/drive/send-token?
incorrectRequest
Response Headers
nginx.conf
pm2 script
Expected behavior
As @mifi says:
Actual behavior
New tab (
https://example.com/companion/drive/send-token?uppyAuthToken=long-token-here
) does not close and returns the error.New Tab source
The text was updated successfully, but these errors were encountered: