Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP nav menu links working but throwing error: Uncaught Error: Syntax error, unrecognized expression: http://localhost:3000/theme_name/ #178

Open
Va2 opened this issue Dec 9, 2019 · 0 comments

Comments

@Va2
Copy link

Va2 commented Dec 9, 2019

Since 2 days I have had a very strange error when I put my main menu in WP. I tried 2 different ways, the first one using the WP functions (register_nav_menus & wp_nav_menu). And the second way by simply putting the urls ("http://localhost:8888/theme_name/", ...) in the href of the links.
The weird thing is that both ways are working and have almost the same error msg:

Error in the first way (WP functions):
Uncaught Error: Syntax error, unrecognized expression: http://localhost:3000/theme_name/

Error in the second way (url in href's):
Uncaught Error: Syntax error, unrecognized expression: //localhost:3000/theme_name/

I use WPgulp to develop my WP theme locally with MAMP. So I have access to the back office and the WP theme via urls with 2 different ports (8888 & 3000):
http://localhost:8888/theme_name/ => MAMP
http://localhost:3000/theme_name/ => WPgulp (npm start to hot reload files etc.)

As mentioned above the links work well so should I just ignore this error that could come from this combination MAMP and WPgulp which have 2 different ports. Because the weird thing is that if I comment the menu (the 2 menus) there is no error and MAMP and WPgulp are also running at the same time...

Probably a silly question but thank you in advance for any information that might reassure me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant