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

Do not fail when browserslist gives a browser that caniuse-api doesn't know about #45

Merged
merged 2 commits into from Aug 6, 2016
Merged

Conversation

onigoetz
Copy link

Hi,

I ran into a weird case this morning and could track down the source to the following scenario:

browserslist and caniuse-api got a different version of caniuse-db, the one in browserslist being more recent and containing "samsung 4" as a browser.

caniuse-db didn't know about this browser and failed the lookup in isSupported with the following stacktrace:

[16:29:43] TypeError: Cannot read property '4' of undefined
    at /work/foundation/sq-web-assets/sq-gulp/node_modules/postcss-cssnext/node_modules/caniuse-api/dist/index.js:79:34
    at Array.every (native)
    at isSupported (/work/foundation/sq-web-assets/sq-gulp/node_modules/postcss-cssnext/node_modules/caniuse-api/dist/index.js:77:6)
    at /work/foundation/sq-web-assets/sq-gulp/node_modules/postcss-cssnext/lib/index.js:74:117
    at Array.forEach (native)

I added a test to reproduce the case and added a fix as well.
If you have a recommendation on a cleaner test I can modify it.

@MoOx MoOx merged commit 425a227 into Nyalab:master Aug 6, 2016
@MoOx
Copy link
Collaborator

MoOx commented Aug 6, 2016

👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants