plurals$$1 is not a function
See original GitHub issueI’ve just noticed an error that was previously working correctly in my setup. I’m having a hard time tracking down what is causing it.
TypeError: plurals$$1 is not a function at Object.plural (/node_modules/@lingui/core/cjs/core.development.js:101:43)
This only seems to happen when using the <Plural> macro
<Plural value={1} one="There is # message" other="There are # messages" />
My app is based off of Next.js
“@lingui/react”: “2.7.2”, “@lingui/macro”: “2.7.2”, “babel-core”: “7.0.0-bridge.0”,
babelrc:
"plugins": ["babel-plugin-idx", "macros"],
"env": {
"development": {
"presets": ["next/babel"],
"plugins": [
[
"babel-plugin-styled-components",
{
"ssr": true,
"displayName": true,
"preprocess": false
}
]
]
},
"production": {
"presets": ["next/babel"],
"plugins": [
[
"babel-plugin-styled-components",
{
"ssr": true,
"displayName": false,
"preprocess": false
}
]
]
},
"test": {
"presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]],
"plugins": [
[
"babel-plugin-styled-components",
{
"ssr": true,
"displayName": true,
"preprocess": false
}
]
]
}
}
}
plurals$$1 is undefined in @lingui/core/cjs/core.development.js where, when I have tested the same setup using Create React App it is a function called ‘en’, some I’m thinking I may be missing something??
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:13 (3 by maintainers)
Had the same error but got rid of it when I setup the i18n with a language, i.e. :
After a bit more investigating it looks like this is caused by setting a new instance of i18n so we could use translations outside of react as suggested in docs:
Removing the i18n prop gets rid of the the error