js-lingui icon indicating copy to clipboard operation
js-lingui copied to clipboard

Module '"@lingui/macro"' has no exported member 'defineMessage'.

Open ThomasSalty opened this issue 2 years ago • 1 comments

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 my babel.config.js:
module.exports = {
  plugins: ['macros', '@babel/plugin-syntax-dynamic-import']
}

ThomasSalty avatar Jun 08 '22 13:06 ThomasSalty

I have meet same question too

jzsn2018 avatar Jun 24 '22 03:06 jzsn2018

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.

stale[bot] avatar Sep 08 '22 22:09 stale[bot]

@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.

Martin005 avatar Jan 07 '23 17:01 Martin005