我遇到的错误只出现在我的开发机器上。我们使用Route的飞镖应用;但是,我收到以下错误:
Uncaught Unhandled exception:
Class '_InternalLinkedHashMap' has no instance method 'pushState'.
NoSuchMethodError: method not found: 'pushState'
Receiver: _LinkedHashMap len:0
Arguments: [null, "", "/index.html#browse"]
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 Router._go (package:route/client.dart:153:22)
#3 Router.gotoPath (package:route/client.dart:139:7)
#4 Router.listen.<anonymous closure> (package:route/client.dart:111:13)
#5 wrap_event_listener.<anonymous closure>.<anonymous closure> (dart:html:1215)
在所有路线上,它不会打开页面。但是,应用程序将打开一些其他页面,如果它已经过去而没有任何超过60秒的行为router.handle('/index.html#');
路由。我甚至在这里测试了其他路线并且它工作(仅在屏幕保护程序上),但不是在路线上的正常点击。
我真的很困惑这里发生了什么。
路由处理程序:
router = new Router()
..addHandler(urls.home, showHome)
..addHandler(urls.browse, showBrowse)
..addHandler(urls.browseProducts, showBrowseProducts)
..listen();
URL:
final String index = '/index.html';
final String pctCls = r'[a-zA-Z0-9-_.~%]';
// TODO: fix home button
final home = new UrlPattern(index + r'#?');
final browse = new UrlPattern(index + r'#browse');
final browseProducts =
new UrlPattern(index + r'#browse/(subcategory|search)/('+pctCls+r'+)');
版本:
OS version: el-caption (OS X 10.11.3)
Chromium version: 39.0.2171.0
Dart VM version: 1.13.2 (Tue Jan 5 06:36:44 2016) on "macos_x64"
感谢您的反馈意见。