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
In development, before extracting new messages, translations are not being compiled meaning variables are not being replaced with their values.
To Reproduce
Set up a project that uses the ESM imports in development mode.
import { Trans } from "@lingui/react"
export default function App() {
const somethingElse = 'replaced'
return <Trans id="my.id">This should be {somethingElse}!</Trans>
}
This will render This should be {somethingElse}! when using the development ESM version of the library @lingui/core (dev.esm.js). This becomes This should be replaced! If you switch to the CJS version (core.development.js or dev.development.js).
Expected behavior
The ESM versions works the same as the CJS version.
Additional context
The issue seems to be that these lines:
ps. the fact that the ESM files are uglified makes debugging harder, and makes the components have unreadable component names in the React Developer Tools and stack traces.
The text was updated successfully, but these errors were encountered:
Describe the bug
In development, before extracting new messages, translations are not being compiled meaning variables are not being replaced with their values.
To Reproduce
Set up a project that uses the ESM imports in development mode.
This will render
This should be {somethingElse}!
when using the development ESM version of the library @lingui/core (dev.esm.js
). This becomesThis should be replaced!
If you switch to the CJS version (core.development.js
ordev.development.js
).Expected behavior
The ESM versions works the same as the CJS version.
Additional context
The issue seems to be that these lines:
js-lingui/packages/core/src/i18n.ts
Lines 188 to 192 in ff7a235
Are missing from the generated ESM file:
I pressume this is because
dev.esm.js
is generated using aproduction
value for the NODE_ENV, rather than development. Looking atjs-lingui/scripts/build/rollup.js
Line 99 in ff7a235
ps. the fact that the ESM files are uglified makes debugging harder, and makes the components have unreadable component names in the React Developer Tools and stack traces.
The text was updated successfully, but these errors were encountered: