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
Describe the bug
Some Text is empty if no defaults prop is set.
I'm not totally sure if this is a babel-plugin-macros issue or an issue with lingui.
To Reproduce
Use ts-loader in webpack before passing to babel-loader.
Initialize with with no props.
import { Trans } from "@lingui/macro"
export default function App() {
return <>
<Trans>Some Text</Trans> // -> Is empty
<Trans defaults="default text">Some Text</Trans> // -> `default text` shows
</>;
}
Expected behavior
I Expect Some Text to render in the absence of a translation.
Additional context
Add any other context about the problem here.
jsLingui version lingui --version 2.7.4
Babel version npm list babel-core 7.3.3
Your Babel config (e.g. .babelrc) or framework you use (Create React App, Meteor, etc.) { "plugins": [ "@loadable/babel-plugin", "@babel/plugin-syntax-dynamic-import", "react-hot-loader/babel", "emotion", "macros" ] }
Using an almost fresh instance of ReactQL boilerplate.
Also getting this notice in console. @lingui/babel-preset-react is probably missing in babel config, but you are using <Trans> component in a way which requires it. Either don't use children in <Trans> component or configure babel to load @lingui/babel-preset-react preset. See tutorial for more info
** UPDATE **
I've confirmed that the macro is not working, as the react element is equivalent to calling from "@lingui/react". I'm not sure why it's not working, but I feel like it should at least give better errors that the macro isn't working.
The text was updated successfully, but these errors were encountered:
chrischen
changed the title
Message ID not being shown when no fallback and no translation
Macros don't work with ts-loader.
Feb 21, 2019
Describe the bug
Some Text is empty if no
defaults
prop is set.I'm not totally sure if this is a babel-plugin-macros issue or an issue with lingui.
To Reproduce
Use ts-loader in webpack before passing to babel-loader.
Initialize with with no props.
Expected behavior
I Expect
Some Text
to render in the absence of a translation.Additional context
Add any other context about the problem here.
lingui --version
2.7.4npm list babel-core
7.3.3.babelrc
) or framework you use (Create React App, Meteor, etc.){ "plugins": [ "@loadable/babel-plugin", "@babel/plugin-syntax-dynamic-import", "react-hot-loader/babel", "emotion", "macros" ] }
Using an almost fresh instance of ReactQL boilerplate.
Also getting this notice in console.
@lingui/babel-preset-react is probably missing in babel config, but you are using <Trans> component in a way which requires it. Either don't use children in <Trans> component or configure babel to load @lingui/babel-preset-react preset. See tutorial for more info
** UPDATE **
I've confirmed that the macro is not working, as the react element is equivalent to calling from "@lingui/react". I'm not sure why it's not working, but I feel like it should at least give better errors that the macro isn't working.
The text was updated successfully, but these errors were encountered: