mledoze / countries

World countries in JSON, CSV, XML and Yaml. Any help is welcome!
https://mledoze.github.io/countries/
Open Data Commons Open Database License v1.0
5.92k stars 1.26k forks source link

Warning when using npm package #490

Closed Gerschtli closed 9 months ago

Gerschtli commented 9 months ago

When using the index.mjs, I get the following warning

(node:121631) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:121631) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time

current content of index.mjs:

export { default } from './countries.json' assert { type: 'json' };
mledoze commented 9 months ago

Thanks for reporting, do you know a way to fix this?

Gerschtli commented 9 months ago

Not from the top of my head. Never did npm packages, so would also need to research on that..

mledoze commented 9 months ago

@lunaneff (since you added the file in #469): could you help figure out what to do here?

Gerschtli commented 9 months ago

I also have this strange issue that with 4.1.1 my vercel deployment can not find the countries.json anymore.. Not sure if this is related, but with 4.0.0 it worked.

thevuong commented 9 months ago

@mledoze Please release the latest version.

mledoze commented 9 months ago

Yes I'd like to but this issue is not resolved. If it's not a problem for your I can release it and provide a fix afterwards.

mledoze commented 9 months ago

Version 5.0.0 is released https://github.com/mledoze/countries/releases/tag/5.0.0

mledoze commented 9 months ago

I looked into the issue here, I reproduced it but was unable to find a solution for it as I am not a NodeJS expert. I really need help to find a fix, if any.

Gerschtli commented 9 months ago

I don't get this warning anymore. Feel free to reopen, if this is still an issue. Thank you!