Closed joeyhub closed 4 years ago
we're not supporting ESM ATM but PR's welcome :)
Does this need to be require instead?
I believe so. We're waiting until all the bundlers and friends support ESM properly
This works:
import MessageFormatParser from 'intl-messageformat-parser/dist/index.js';
It's a standard workaround but I'm a bit confused because even that wasn't working before. I updated node and the NPM packages so I suspect a bug somewhere stopped that from working before.
Other wise with ESM depending what you do to get it to work without falling back to CJS will either break in node or rollup.
We don't set the necessary meta fields in package.json
for Node to recognize it as ESM because that confuses the other bundlers, which is prob why you need to import from a specific path. Just a guess...
I'm not able to import intl-messageformat-parser 4 in node.js 13, using ESM (mjs and "type": "module").