Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Shopify Custom app proxy base url pointing to my shopify store instead of proxy

Shopify Custom app proxy base url pointing to my shopify store instead of proxy

fremfi
Tourist
10 0 3

Hi everyone. I’m using the shopify cli to create a custom app for my store. I managed to setup the app proxy and get it to display the intial render. But it seems that nextjs is building my html using relative paths and therefore the application is trying to get the js,css files from the shopify store instead of the proxy. Is there a way to fix this? ps: when i view the app with the Shopify admin, its rendered within an iframe with the correct base URL pointing to my proxy

 

Screen Shot 2020-04-19 at 2.10.08 PM.pngScreen Shot 2020-04-19 at 2.09.56 PM.png

Replies 2 (2)

hassain
Shopify Staff (Retired)
624 104 189

Hi @fremfi ,

 

You might be able to leverage the solution from this forum post that had someone facing a very similar problem to yours: https://community.shopify.com/c/Shopify-APIs-SDKs/App-Proxy-Sending-index-html-throws-404-on-the-JS-...

 

In short, this user also was getting 404 errors in their App Proxy for their css and js assets. They resolved this by updating their package.json to set their homepage path, and then also set up middleware using ExpressJS so their assets can be accessed.

 

To learn more visit the Shopify Help Center or the Community Blog.

Web-Solutions
Shopify Partner
1 0 0