-
Notifications
You must be signed in to change notification settings - Fork 413
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
MiddlewareStack duplicate handler issue on Microsoft Edge & Chrome Canary #1513
Comments
I can confirm this is also happening in the latest version of Chrome Canary (currently v50.0.2653.0 but it started in v50.0.2651.0 I believe). |
Thanks @MiroHibler, I could reproduce in Chrome Canary too, but only after enabling " |
@nathan-muir is this definitely the fix? iron-meteor/iron-middleware-stack#8 |
@chrisbutler It's a fix (I've currently deployed for my apps); Use at your own discretion, |
Hi @nathan-muir -- I am not maintaining IR at this point. I'm not sure what the current status of maintenance is. @cmather? |
I can verify this behavior on Version 51.0.2669.0 canary (64-bit) without touching the default setting for Experimental Javascript (disabled). Removing the second onBeforeAction hook fixes the problem. |
Looks related: #1520 I do have multiple global |
@lorensr yeah, that would be it |
Receiving this error in Chrome canary 51.0.2673.0:
From a simple:
Until @nathan-muir's code is reviewed and pulled into main repo, the error can be subdued by forcing each route to be named:
|
Thanks @Zlot. That's fixed it for me on Chrome Canary 51.0.2673.0 (64-bit) as well. |
In newer browsers (chrome canary, IE11 as of this writing) this gets set automatically based on for instance object property names. This leads to lots of problems with duplicate names iron-meteor/iron-router#1513
Fixed: |
This fixes the following issue: iron-meteor/iron-router#1513
I understand there's a resolution for this but it may be worth noting that it's impacting Chrome 51.x which is now stable. |
Running |
@brewhk-dev what version of I:ms did you end up with? |
I suspect I need to do a release of iron router that explicitly depends on this fixed version. |
Our app is running on METEOR@1.1.0.2, with the follow
Chrome version - 51.0.2704.84 (64-bit) But simply updating the package didn't work for us, we had to make sure the routes are named. |
@brewhk-dev --- that is very surprising to me. Can you provide a simple reproduction of the problem? |
Ok, released |
Wont fix with |
What does that mean? I don't understand how naming routes could fix this problem if it still occurs with that version. It removed code that looks at names. |
Edit: Removing this. Error on my side. Fix looks good. |
@tmeasday I tried adding this fix but with my Meteor version
Any ideas? |
Looks like you may be on an old version of Meteor? |
…s affected but just in case)
Yep, updating middleware-stack worked for me. Nice job @tmeasday and all IR contributors :) |
Before this, console shows error that; Uncaught Error: Handler with name 'route' already exists. while using Chrome 51 and this (iron-meteor/iron-router#1513) also shows that it also occurs in Chrome 50+
Just like @brewhk-dev, naming the routes worked for me while updating didn't |
@tmeasday I am indeed on an older version of Meteor and ended up updating the middleware-stack |
@tmeasday Not sure if you're still maintaining this. This is kind of related to #986 which you commented on. Also relates to #1270, and #1328.
This example now fails in the Microsoft Edge browser. (& Also in Chrome Canary w/ Experimental Javascript On.)
Why:
Because
MiddlewareStack
does some funky things with function names and uniqueness.In Microsoft Edge, we now have new behaviour with function names & object literals:
That's right, anonymous functions now get names in object literals, even without using es6 object syntax.
How:
MiddlewareStack._create
enforces a 'unique' mapping ofHandler
's names.Handler
automatically "picks" a name for any-named functionProposed Solution:
I can't find any code in
iron-router
that even uses any of the name-related API's. (findByName
,insertBefore
andinsertAfter
).So there are really two options:
MiddlewareStack
. (Maintaining existing API's if someone is using it?)name
related fromMiddlewareStack
, and bump a major version. Pull RequestThe text was updated successfully, but these errors were encountered: