Built react app `n.t` is not a function
See original GitHub issueSource code causing the error is simply ${i18n.t
over} ${moment(disconnectedTime).fromNow()}
. This works fine in development but throws n.t is not a function
when the app is built for production.
This is a stateless functional component ‘enhanced’ with withI18n()(Component)
. Logging props.i18n
results in:
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
TypeError: Object(...) is not a function reactjs
Doing it this way now throws a "TypeError: Object(...) is not a function" error and I don't know why. Here is what Calendar.js...
Read more >Create a New React App
Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any...
Read more >Create an ASP.NET Core app with React in Visual Studio
If you see this issue, most likely the frontend started before the backend. Once you see the backend command prompt up and running,...
Read more >Getting started with React and Contentful
The first thing is to bootstrap a new React application. ... On Your Network: http://192.168.2.103:3000 Note that the development build is not optimized....
Read more >React JavaScript Tutorial in Visual Studio Code
The Visual Studio Code editor supports React.js IntelliSense and code ... To debug the client side React code, we'll use the built-in JavaScript...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, order of plugins/presets is important. Presets are applied from bottom to top, and
@lingui/babel-preset-react
should be applied first.i18n.t
is definitely undefined in production, because plugins transforms alli18n
calls to low-leveli18n._
method.I’m going to add it to docs!
Following https://lingui.js.org/tutorials/react-patterns.html I get
t is not defined
when translating element attribute.package.json
webpack.config.js
babel.config.js
lingui.config.js
Even
console.log(t)
right after import block throws an error. Is there anything I’m doing wrong?