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

Crawl fails for non-redirect matchers (matcher is not a function) #124

Open
kmkr opened this issue Aug 12, 2019 · 2 comments
Open

Crawl fails for non-redirect matchers (matcher is not a function) #124

kmkr opened this issue Aug 12, 2019 · 2 comments

Comments

@kmkr
Copy link
Contributor

kmkr commented Aug 12, 2019

crawl doesn't work on certain older browsers and throws TypeError: matcher is not a function.

The problem seems to be caused by the returned promise from createCrawlTuplesPromise that resolves to incorrect data types. The resolved value is expected to be an array where the items is a tuple containing one function and one object, but is rather one string and one object.

Here is an example where the promise resolves incorrectly (on Chromium v 65.0.3325). Notice the string type in the first item of the result, starting from index 13:

crawl-tuples-with-different-data-types

Here's an example where the promise resolves correctly (latest Chromium):

crawl-tuples-with-correct-data-types

Here is the result of the paths-variable within the createCrawlTuplesPromise. I suspect the problem is within this function.

createCrawlTuplesPromise-paths

redirect matchers are resolved correctly but withView and mount matchers do not. I've debugged and went through the code but I'm having a hard time understanding the data flow and generators. Any idea what may be the cause?

@kmkr kmkr changed the title Crawl fails for non-redirect matchers (i is not a function) Crawl fails for non-redirect matchers (matcher is not a function) Aug 12, 2019
@jamesknelson
Copy link
Collaborator

Thanks for brining this up! What a bizarre bug.

Any chance you could quickly run Object.entries({}) in the version of chrome that this is failing on, and see if it works?

@kmkr
Copy link
Contributor Author

kmkr commented Aug 14, 2019

Yes, of course. It seems to generate the expected result:

Chromium 65:

chrome-65

Chromium 75:

chrome-75

I also ran the code in our webapp with the same result. I did that to cover the case where some polyfill could be messing with Object.entries.

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