Build a Shopify App with Node.js and React - pageg/annotated-layout.js doesn't appear

Solved
theothersteve
New Member
2 0 5

@Bosiyaw This solution seemed to work for me: https://community.shopify.com/c/Shopify-Apps/New-page-redirects-to-index-on-app-created-using-CLI/td...

It basically says that we need "to add the router.get for that page to the server.js file." So, here's what I added to my server.js file, and now I can see the "annotated-layout" page/tab in the app:

router.get("/annotated-layout", handleRequest);

The handleRequest variable is already defined earlier in server.js for handling pages:

const handleRequest = async (ctx) => {
	  await handle(ctx.req, ctx.res);
	  ctx.respond = false;
	  ctx.res.statusCode = 200;
	};

Not sure if this is THE 100% CORRECT solution (since it's not part of the tutorial), but it got me to the next steps. Good luck!

Bosiyaw
Tourist
3 0 1

Hey @theothersteve,

thank you very much for your time and effort. But for me its still not working, its pure frustration ... i will read some more on this and hopefully will create some cool apps in the near future Good luck!

0 Likes
cthompson
New Member
2 0 1

You should be able to append the handle to the end of the url anyway.  But, for some reason it does not work.  Not sure why.  This may be an oversite by the author.

0 Likes
Gowtamsankar
New Member
2 0 0

yes I followed still cant get annotated layout page

0 Likes
theantipioneer
Tourist
4 0 0

Try restarting your computer that worked for me

 

0 Likes
Bosiyaw
Tourist
3 0 1

is there still no hands.on solution to this "enable cookies" and navigation routing problem? I would really like to dive deeper into app development with shopify but i cant get over this step. I also set up an app with the shopify app cli and its the same problem again. Its getting really frustrating so i would love to get a resolution on this topic. What i tried so far:

- Changing Browser
- Deleting Cache and Cookies
- Enabled cookies in the browser
- All solutions which got suggested in this thread
- set everything up with shopify app cli 

Its always the same - if i append the annotated-layout in the url or do a navigation menu, doesnt matter - i always get to a screen, where i should enable cookies and then get forwarded to my index page again, not even beeing able to click something because the enable cookie screen disappears so fast or timing out after that. 

Here is a Screencapture of the Problem: https://www.loom.com/share/8ab9a24a15654d0fb125fffea6700528

Best Regards


0 Likes
tomasdelaveau
Tourist
16 0 1

I believe by adding that line of code you're skipping verification on that route, which is what this line does:

router.get("(.*)", verifyRequest(), handleRequest);

 I think the problem is related to cookies.

0 Likes