js-lingui
js-lingui copied to clipboard
Module '"@lingui/macro"' has no exported member 'defineMessage'.
Describe the bug
Wanted to try out the defineMessage
macro in a React/Typescript project but received this error message from my IDE (vs code):
Module '"@lingui/macro"' has no exported member 'defineMessage'.
To Reproduce Steps to reproduce the behavior, possibly with minimal code sample, e.g:
import { defineMessage, Trans } from '@lingui/macro'
Expected behavior
Not receiving that error message. Please note that importing t
or Trans
does not produce this error message.
Additional context Add any other context about the problem here.
- jsLingui version
lingui --version
: 2.8.3 - Babel version
npm list @babel/core
:
+-- @babel/[email protected]
+-- [email protected]
| `-- @jest/[email protected]
| `-- @babel/[email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- @babel/[email protected]
- Your Babel config (e.g.
.babelrc
): this is mybabel.config.js
:
module.exports = {
plugins: ['macros', '@babel/plugin-syntax-dynamic-import']
}
I have meet same question too
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@ThomasSalty @jzsn2018
Hello, could you please tell me what version of the @lingui/macro
package you used your projects?
If you used the version 2.8.3
as your initial comment suggest, then you will have to update the package to version 3.0.0
or later to use the defineMessage
macro as previous versions didn't have this feature.