Although this is an old topic. i found myself still encounter this problem.
I believe for the majority using ember for the web locationType: ‘auto’ works fine, so this problem might not be relevant. However when using ember on hybrid mobile app (cordova/phonegap), as far as i am aware i am stuck with locationType: ‘hash’ and this is still an issue.
As far as scrollspy is concerned, has it occur to anybody it might be problem on the bootstrap side?
When I switch to locationType: ‘hash’ i get this error from scrollspy
Uncaught Error: Syntax error, unrecognized expression: #/posts
in the bootstrap it is doing this
var $href = /^#./.test(href) && $(href)
see https://github.com/twbs/bootstrap/blob/master/js/scrollspy.js#L60
It appears to be testing if the href is a valid fragment the regular express think it is but $(href) generate error. I would think the problem at least with scrollspy it needs a better or maybe more robust way to test a valid fragment.
quickly change the regex to /^#\a/ (correct if i am wrong) scrollspy works fine for me. It is very interesting to me and I would probably submit an issue in the bootstrap side.
from http://www.w3.org/TR/html401/types.html#type-name
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (“-”), underscores (“_”), colons (“:”), and periods (“.”).
from rfc 3986 https://tools.ietf.org/html/rfc3986
fragment identifier component is indicated by the presence of a number sign (“#”) character and terminated by the end of the URI.
fragment = *( pchar / "/" / "?" )
so it appers the regex test need to at least satisfy both conditions
looks like it is a “won’t fix” see https://github.com/twbs/bootstrap/issues/14187