What's your biggest current challenge? Have your say in Community Polls along the right column.

AppBridge invalid origin issue while embedding the app

AppBridge invalid origin issue while embedding the app

Harsh_shukla
Shopify Partner
2 0 2

I have embedded the app using App Bridge version 3.7.9. Our app's client and server domains are different. Previously, the app's URL (from the partner panel) was on the client's domain. However, an issue arose with the Content-Security-Policy in the iframe. Setting the recommended CSP from the client's end was challenging, so we configured it from the server end. Consequently, we changed the authentication login process to use the server domain. As a result, our app's URL is now on the server domain.

Although the app is opening in the iframe within the Shopify admin, the App Bridge is encountering an issue in identifying the origin, leading to the following error:

 

AppBridgeError {name: 'AppBridgeError', message: 'APP::ERROR::INVALID_ORIGIN', action: {…}, type: 'APP::ERROR::INVALID_ORIGIN', stack: 'AppBridgeError: APP::ERROR::INVALID_ORIGIN'}

Due to this error, App Bridge functionalities such as the side panel navigation bar and route state persistence are not working.
How can I resolve this? My app is built in React.

Reply 1 (1)

tattran86
Shopify Partner
2 1 2

Have you resolved the above problem yet? Are there any new updates?