Closed forsbergplustwo closed 1 year ago
Thanks for reporting this @forsbergplustwo. We'll investigate the issue!
Thank you @elanalynn 🙏 Any luck in tracking it down?
Not sure if it makes tracking this down easier, but I also see the same error being logged by Shopify's own xxxxxxx.shopifyapps.com
services:
I've worked out the issue causing this, and have it fixed locally 🎉
When creating the modal, if you pass a path that does not contain the host=xxxxxxxxxxxxx
parameter, then all communication with the embedding app stops working.
_Sidenote: Unfortunately we cannot add host
to default_url_options
Rails (as it's already used internally by Rails to set the url.host), so we have to pass it in manually append it to urls, without path helpers. Simplified example:_
<%= exports_path(ids: @order_ids, order_type: @order_type).to_s + "&host=#{@host}"
Hopefully this helps others.
Describe the bug
When using app bridge Modals on a
admin.shopify.com
based store, the following error is thrown whenever postMessages are dispatched.This happens both when calling the provided function:
setupModalAutoSizing(app)
as well as dispatching data through the provided modal api:app.dispatch(Modal.data(payload));
The same code works as expected when on a
xxxxx.myshopify.com/admin
based store.To Reproduce
Steps to reproduce the behaviour:
admin.shopify.com
based store, which includes thesetupModalAutoSizing(app)
callSame app on .myshopify.com based store:
Expected behaviour
I would expect the functions to work the same on a admin.shopify.com based store, as it does for a xxxxx.myshopify.com/admin based store.
Contextual information
Packages and versions
List the relevant packages you’re using, and their versions. For example:
Platform
Additional context
This is not a new app, it has had these functions in production for 1+ years, and as mentioned works on myshopify.com based stores.