Closed cscognamiglio closed 8 years ago
I don't use webpack so can't comment. Anyone else have any observations?
Same issue. Throwing a debugger in the script where I'm importing 'country-data', countryData.countries.all
returns an empty object.
Same issue.
import countryData from 'country-data';
console.log(countryData);
I'd like to fix this. As I've never used webpack please could you provide me with the steps needed to reproduce this error starting from an empty directory. The more detailed the better, and if it can be easily adapted into a test case that would be superb. :) On Thu, 4 Aug 2016 at 16:46, freen notifications@github.com wrote:
Same issue.
import countryData from 'country-data'; console.log(countryData);
[image: screen shot 2016-08-04 at 16 45 38] https://cloud.githubusercontent.com/assets/1816457/17406240/f03c368e-5a62-11e6-86a6-262174b646c8.png
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/OpenBookPrices/country-data/issues/57#issuecomment-237575680, or mute the thread https://github.com/notifications/unsubscribe-auth/AALc7knzWs5f8mK04XYRECgywkFNQUk2ks5qcftDgaJpZM4JYYSt .
I had to install and configure json-loader
in webpack to fix this:
npm install json-loader --save-dev
// webpack.config.js
// ...
loaders: [
// other loaders
{ test: /\.json$/, loader: 'json' },
],
// ...
Thank you @luxflux - would adding the webpack.config.js
file to country-data
be a way to close this issue?
Hm, I'm pretty new to this stuff as well... But I don't think adding webpack.config.js
would help as this is a config which is project specific and won't automagically be searched in the dependencies.
IMHO mentioning this in the README would be sufficient.
Thanks for the input. Notes about webpack added to README and code now on NPM as v0.0.28
Hi, I am not getting how to use it with webpack&c:
import CountryData from 'country-data'; CountryData.lookup.countries({currencies: 'EUR'});
generates: Uncaught (in promise) TypeError: data.filter is not a function(…)
Am I doing something wrong?