(Fixed) Node.js ESM issue
Prerequisites:
- Either add
type: "module"flag in the application'spackage.jsonfile. - Or write the application's code in an
.mjsfile.
Then the following code won't work — none of the "named exports" would be found:
import {
isPossiblePhoneNumber,
isValidPhoneNumber
} from 'libphonenumber-js';
Reproduced on Node 14+.
Edited by Nikolay Kuchumov