StephanGeorg / iso-countries-lookup

Find country codes by country names in multiple languages.
MIT License
8 stars 1 forks source link

countryCodeLookup only works serverside #1

Open ottworks opened 5 years ago

ottworks commented 5 years ago

For some reason this package only works serverside. I'm using these packages, do you know what could be causing the issue? server.js:

const countryCodeLookup = require('iso-countries-lookup');
console.log(countryCodeLookup('Germany')); // 'DE'

index.jsx:

const countryCodeLookup = require('iso-countries-lookup');
console.log(countryCodeLookup('Germany')); // undefined
StephanGeorg commented 5 years ago

Hm? Good question! But honestly I developed it for a serverside environment. The static data which is responsible for translations and stuff is about 700kb (https://github.com/StephanGeorg/iso-countries-lookup/tree/master/src/data). This shouldn't be shipped to client.

But nevertheless I will review how this can happen. Thanks for the hint @ottworks