Closed bfeldner closed 3 years ago
Hi @bfeldner, thanks for reporting this problem.
Apparently the ESM build is only exporting a default
(the whole package) but not individual functions.
As a quick fix, this should work:
import ct from "countries-and-timezones";
const App = () => {
const allCountries = ct.getAllCountries();
However, let me try other solutions to make import { getAllCountries } from "countries-and-timezones";
works as well.
Hi @manuelmhtr , thank you for your response.
Hi @bfeldner,
I just released version v3.0.1
which supports named ESM exports. Your original code should work with this version.
We are using the getAllCountries method in our next.js v. 11 project, which stopped working when updating countries-and-timezones from 2.4 to 2.5.0.
Made a minimal example showing the error: https://codesandbox.io/s/nextjs-forked-5uj7q