You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sonny@machop ~/foo > npx ttag update locales/es.po server/
⠙ app/src/App.jsError: /foo/bar.js: You should use ttag imports in form: "import { t } from 'ttag'"
If I try to use named imports with ttag on Node.js ESM I get the following error:
import ttag, {t} from 'ttag';
^
SyntaxError: Named export 't' not found. The requested module 'ttag' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'ttag';
const {t} = pkg;
The text was updated successfully, but these errors were encountered:
Hi @sonnyp, thanks for the feedback!
I think ESM module support is a must-have feature. Need to think about how we can add this support, one thing that we need to keep in mind is that commonjs version must not be broken. Maybe you have some good examples of packages that have esm support already?
👍 for this.
I'm using Remix and it's throwing the following error
[vite] Named export 't' not found. The requested module 'ttag' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
Using "native" Node.js ESM doesn't work with ttag because the
ttag
module only has a default export there and no named exports.If I try to use named imports with
ttag
on Node.js ESM I get the following error:The text was updated successfully, but these errors were encountered: