404 error when adding wordpress menu to api

Hello :blush:

I’ve just watched @mburridge 's video about adding the WordPress menu to the api and am having a few issues. When I see if I’ve managed to “insert” the menu into the api it gives me a 404 error saying the following:

But when I check the json object like Michael did then I can see that the “navbar-menu” exists in the api endpoint for the menus:

Here’s my code for the menu handler:

index.js where I add the menuUrl and the fetch:

and finally the nav.js where I connect to the state:

Here is the URL of my WP rest API http://127.0.0.1:10080/wordpress/wp-json/menus/v1/menus/

I’ve had a look in some of the other threads where people are having trouble accessing the menu and can’t find anything that would help me. So I’d be grateful for an extra set of eyes on my code etc :sun_with_face:

Many thanks in advance!
Claire.

Hie @clairecaudwell

Can you please provide a repo or code-sandbox with your code? This is especially helpful to find solutions to technical issues with specific code

Detailing the info suggested here when having issues will help the community to provide the best possible help as quickly and as efficiently as possible.

As this is a local URL I’m afraid this is not helpful for the community to try to replicate and understand your issue

Hello @juanma

Yes sorry about that, I realised that afterwards that this wouldn’t help. Apologies. I’m a junior developer and this is my first time working with WordPress. So thank you for your patience!

Here’s my github repo GitHub - ClaireCaudwell/claire-nkjt-site

@juanma Me and my colleague managed to solve the issue. I hadn’t put the source handlers inside the libraries section in index.js. Sorry about that and thanks for your help!