JulianMar / nuxt-bugsnag

Bugsnag module for nuxt.js
MIT License
49 stars 18 forks source link

Problem with CORS after initial load #26

Closed rudolfbruder closed 3 years ago

rudolfbruder commented 3 years ago

Hi,

I am trying to use this package with my laravel nuxt project which is SSR. On initial page load which comes from server the errors are being send and appear on the bugsnag report however once the 'SPA' mode turns in the app is unable to send the request to bugsnag with the typical cors error, see picture:

image

I was think whether this has something to do with axios setup but it seems it does not because it actually does not use nuxt axios module because it does not incl due headers which i specified during the axios setup.

I am sure it is because it is missing the headers in the request here:

image

Do you have any idea how could I solve this issue please?

Thank you very much!

JulianMar commented 3 years ago

Hey, hmm this is very weird. As far as I can tell it has nothing to do with the library.

But I can try to help you work through this problem. So basically it uses the bugsnag js library, where I didn't find any issues related to your Problem. Do you maybe have a reproducable version?

rudolfbruder commented 3 years ago

Hello,

You know what I have discovered this weekend, the problem exists only in Firefox. In google Chrome the CORS error is not present. I have no idea why it is happening in firefox only. Pity that I am so used to firefox.

JulianMar commented 3 years ago

ohh wow, you are right. This is maybe a bigger issue. I will try to find out more

JulianMar commented 3 years ago

scrape that 🤦🏼 . I had ublock origin activated. For me it works on firefox

rudolfbruder commented 3 years ago

It's interesting because I have an Laravel / Nuxt.js application with SSR. On the first page load when the page is server from the server the bugsnag runs through. I guess because it is handled by the laravel cors settings. Then when it's handle by the front end it is not using the axios setup but it's own request setup i guess which ignores my headers.

JulianMar commented 3 years ago

but why do you do you need special settings? Do you a proxy or something like that setup for your bugsnag requests? Can you maybe share your nuxt.config?

Another question would be, do you use laravel as API? Like maybe the laravel-nuxt project?

rudolfbruder commented 3 years ago

@JulianMar you solved it. I did not have ublock but some other adblock called AdBlocker Ultimate. I disabled it and it works now. Thank you very much! Hope this helps other people with adblock enabled.

JulianMar commented 3 years ago

awesome! But weird that on Firefox it's a cors error, when it's blocking the requests