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

Syntax error, unrecognized expression #11

Closed
Zettersten opened this issue Oct 28, 2011 · 8 comments
Closed

Syntax error, unrecognized expression #11

Zettersten opened this issue Oct 28, 2011 · 8 comments

Comments

@Zettersten
Copy link

var routes = [
    "#/home",
    "#/obstacles",
    "#/obstacles/:id"
];

Path.map(routes[2]).to(function(){
    app.route(this.path, this.params["id"]);
});

When looping through an array of routes, firefox - firebug throws a

  • uncaught exception: Syntax error, unrecognized expression: id

Any reason why this is happening?

@Zettersten
Copy link
Author

in the example above, im obviously not looping... but I am showing when the loop hits the 2nd item which is the item with a param available.

Whenever it hits a route string with a param it throws the error

@mtrpcic
Copy link
Owner

mtrpcic commented Oct 28, 2011

Could you provide a complete piece of javascript as a gist and/or pastie with some test routes and I'll take a look immediately.

@mtrpcic
Copy link
Owner

mtrpcic commented Oct 28, 2011

I have a suspicion the problem is because you're looping through the routes, and you're attempting to access the parameter "id" in side every run of the loop. In that situation, the problem would be that some of those routes don't have that parameter.

@mtrpcic
Copy link
Owner

mtrpcic commented Oct 28, 2011

I believe the problem may be with your call to app.route, where you may potentially be passing in an undefined value in place of id. Please take a look at this gist and run it. It works in FF and Chrome using the latest PathJS (v0.8).

@mtrpcic
Copy link
Owner

mtrpcic commented Nov 29, 2011

Is there any news on your issue? If there is no word on the issue within 48 hours, I will consider the issue user-fault rather than code-fault and close this issue.

@mtrpcic
Copy link
Owner

mtrpcic commented Dec 27, 2011

This issue is closed due to the following two reasons:

  • I can not reproduce this bug
  • The user who reported it is no longer responding, and as such, I feel it was likely user error

@mtrpcic mtrpcic closed this as completed Dec 27, 2011
@Zettersten
Copy link
Author

Sorry Mike, I haven't had time to isolate the issue and fiddle it for you.

If you want to take a look at it, visit nenvy.com/a/css_off

You'll see the error. You can examine the implementation.

I use path.js a ton - so I'm sure I'll eventually get this issue properly documented.

Until then - sorry for the lack of proper "git"!

@mtrpcic
Copy link
Owner

mtrpcic commented Dec 27, 2011

I am not getting any errors on the linked page. What browser were you encountering the errors on? I'm testing on Firefox 8.0.1.

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

2 participants