justinfagnani / route

A client + server routing library for Dart
BSD 3-Clause "New" or "Revised" License
114 stars 40 forks source link

IE 10 and 9 No handler found for /##/ #27

Closed marcog83 closed 10 years ago

marcog83 commented 11 years ago

Hi, i'm developing a little prototype in Dart based on angularjs phonecat tutorial.

I used route library to swap from to different views.

http://webui.demo.local/ is the homepage

and http://webui.demo.local/#/phones/motorola-xoom-with-wi-fi is the product-page

I have 2 urlPattern to match

final UrlPattern searchUrl = new UrlPattern(r'/');
final UrlPattern detailsUrl=new UrlPattern(r'/#/phones/(\S+)');

// My router
final Router  router= new Router (useFragment:null);
router.addHandler(searchUrl, showHome);
router.addHandler(detailsUrl, showDetails);
router.listen();

and an anchor tag like this


   <a href="#/phones/motorola-xoom-with-wi-fi">motorola-xoom-with-wi-fi </ a >

On Chrome and Firefox my project works, but on IE 10 and 9 it does not :(

IE9 Console output:

SCRIPT5022: Illegal argument(s): No handler found for /##/phones/motorola-xoom-with-wi-fi 
index.html_bootstrap.dart.js, Riga 7731 Carattere 7

Dart Editor version 0.5.0_r21823 Dart SDK version 0.5.0.1_r21823

dependencies versions

image

P.S. In general, what is the difference using useFragment:null/true/false?

Thanks marco

pavelgj commented 11 years ago

Can you please confirm which version of route package you're using?

useFragment is a way to explicitly tell the framework either to use location assign or history pushState. By default (null) it will try to determine automatically which one to use.

pavelgj commented 11 years ago

Nevermind, I see it's 0.4.5.

pavelgj commented 11 years ago

I don't have IE 9/10 handy so I'll try to go by code. To clarify, does this happen when you click on the link or when you click back/forward button in the browser?

marcog83 commented 11 years ago

It happens when i click on the link.

This is the demo link http://exchange.nurunadv.com/dart/webui/

About back/forward button on Chrome and Firefox: I started at http://webui.demo.local/ OK clicked on the first thumbnail http://exchange.nurunadv.com/dart/webui/#/phones/motorola-xoom-with-wi-fi OK clicked back button in browser http://webui.demo.local/ OK clicked forward button in the browser http://exchange.nurunadv.com/dart/webui/#/phones/motorola-xoom-with-wi-fi but the view did not change

thanks marco

pavelgj commented 11 years ago

I just pushed a fix to the master branch, can you please try that version of the client.dart? If it still cause problem, please add the following to your main class/method and include the output...

import 'package:logging/logging.dart';

main() {
  new Logger('')
      ..level = Level.FINEST
      ..onRecord.listen((r) => print('[${r.level}] ${r.message}'));
}
pavelgj commented 10 years ago

assuming fixed