browserslist / caniuse-lite

A smaller version of caniuse-db, with only the essentials!
Creative Commons Attribution 4.0 International
547 stars 77 forks source link

TypeError: region is not a function (from browserslist) #73

Closed romainmenke closed 3 years ago

romainmenke commented 3 years ago

I think this is related or the same issue as #70

versions :

TypeError: region is not a function

Trace :

TypeError: region is not a function
    at Object.loadCountry (/node_modules/browserslist/node.js:234:23)
    at Function.select (/node_modules/browserslist/index.js:898:11)
    at /node_modules/browserslist/index.js:336:33
    at Array.reduce (<anonymous>)
    at resolve (/node_modules/browserslist/index.js:318:18)
    at browserslist (/node_modules/browserslist/index.js:444:21)
    at /node_modules/postcss-preset-env/index.js:434:29
    at creator (/node_modules/postcss/lib/postcss.js:133:35)

Code from browserslist :

https://github.com/browserslist/browserslist/blob/main/node.js#L234

var feature = require('caniuse-lite/dist/unpacker/feature').default
var region = require('caniuse-lite/dist/unpacker/region').default

var compressed = require('caniuse-lite/data/regions/' + code + '.js')
var usageData = region(compressed)
ai commented 3 years ago

Fixed 1114c93ed

ai commented 3 years ago

The fix was released in 1.0.30001227

CastileMan commented 3 years ago

you breaks my heart again..

romainmenke commented 3 years ago

Confirmed! Thank you for the very fast response and release! ❤️