Pilot-in / PiloPress

The most advanced WordPress Page Builder using Advanced Custom Fields & TailwindCSS
https://www.pilopress.com
62 stars 11 forks source link

Getting a "Unhandled Promise Rejection: Cannot read properties of undefined (reading 'sameOrigin')" while Pilo'press is activated #240

Closed jesperholstjh closed 1 year ago

jesperholstjh commented 1 year ago

Describe the bug When Pilo'Press is activated on my site, I get the following error:

admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5 Uncaught (in promise) TypeError: Unhandled Promise Rejection: Cannot read properties of undefined (reading 'sameOrigin') at At.isAllowedOrigin (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:49098) at At.shouldGenerateTrace (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:48932) at At.generateTracePayload (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:47832) at f.w (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:52552) at Object.m [as emit] (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:7304) at Object.m [as emit] (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:7242) at e.<computed> (admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fsetup.php:5:36977) at v (app.js?ver=4.6.3:8:14128) at app.js?ver=4.6.3:8:14354 at app.js?ver=4.6.3:8:82439

I'm not very technical, but as far as I can test, the error seems to apear when I try to fetch or save some data via ajax/api.

To Reproduce As soon as the plugin is activated, when using a save-button, a dropdown etc that save data without a page-refresh it gives me this error.

Expected behavior I expected that the error in the console is not there, and I am able to save the things i'm doing.

WordPress, Plugins WordPress version: 6.2 Pilo'Press version: 0.4.3.1 | ACF Pro version: Version 6.0.7 ACFE version: Version 0.8.9.3 ACF add-ons:

jerome-pilotin commented 1 year ago

Hello @jesperholstjh

Thank you for your issue. Could you share more information on your environment? Versions of Apache or your web server, PHP, whether you are using Docker, is it a dev environment or online?

At first glance, the issue seems related to your web environment on which WordPress is installed

jesperholstjh commented 1 year ago

Hi @jerome-pilotin

It seems like you are correct. The issue seemed to be related to our New Relic client. As soon as we disabled that, it seems to work again.

I'll have a look into if there is an actual error that New Relic tried to pass, but for now it seems to work. The weird part is though that the error went away when Pilo'Press was disabled.

jerome-pilotin commented 1 year ago

Good to know you have fixed the issue!

I know that we are doing some funky things related to the server's hostname and the likes so it doesn't suprise me. If you ever find the real culprit, I'd like to know in order to improve the addon. Thank you for taking the time to share your issue with us!