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

fremfi
Tourist
10 0 1

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

0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 135

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.

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes