-
Notifications
You must be signed in to change notification settings - Fork 682
Description
What happened?
Description
I suspect this is a result of hosting our CP on a different domain to the primary site, we are seeing some strange JavaScript errors in the CP.
Steps to reproduce (using DDEV but reproducible in an AWS environment as well)
-
Standard Craft installation using DDEV with CP on separate domain to main site i.e.
BASE_CP_URL="https://admin.ddev.site"
PRIMARY_SITE_URL="https://main.ddev.site" -
Add NGINX configuration to allow CORS
`
location ~* .(?:js?)$ {
add_header Access-Control-Allow-Origin "*";
}
Expected behavior
JS bundles should load as expected in the CP and not cause any console errors
Actual behavior
We see the following issues:
-
Attempting to create a new matrix block throws a console error (only when selecting the Matrix field type):
Uncaught TypeError: Craft.MatrixConfigurator is not a constructor. This prevents any model dialog from rendering (i.e. when adding a new block type), can workaround this by trying to save the field, which fails, and then the model will appear as expected (no JS error anymore)

Once reloaded the 'bubble' appears

-
Similar issue seen with the Image Resizer plugin, I had raised this in Uncaught TypeError
ResizeElementActionverbb/image-resizer#77 but given the above wondering if the problem is more Craft related? -
When adding new entries field, we see
Uncaught ReferenceError: htmx is not defined, possible that this is coming from the Sprig plugin (that's the only thing I can think of using htmx?) but odd this only affects the entries selection?

-
We also see the above when selecting blocks inside a Vizy field

Craft CMS version
Craft Pro 4.5.3
PHP version
8.2.9
Operating system and version
Linux
Database type and version
MariaDB 10.4.30
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions (all latest)
- Amazon S3
- AsyncQueue
- CKEditor
- Feed Me
- Formie
- ImageOptimize
- Image Resizer
- Retour
- SEOMatic
- Sprig
- Super Table
- Vite
- Vizy