question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"cli extract" fails when I do not use macro and have no babel macro package installed

See original GitHub issue

Describe the bug

I’m using Next.js. I do not need macros, so I decided not to install @babel/macro etc. I did it because I want Next.js to use SWC.

To Reproduce

Create a minimal Next.js project. Do not install anything related to macros. Run yarn extract.

Console logs gets lots of warnings - lingui-extract.js tries to use babel-plugin-macros.

Expected behavior

extract/compile should work without babel-plugin-macros dependency.

Additional context

  • jsLingui version 3.13.2

  • Your Babel config (e.g. .babelrc) - Next.js; no custom babelrc config.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
megliocommented, Jul 2, 2022

What’s the idea behind automatically closing issues that are not rejected explicitly? If nobody can take care of it now, it does not mean the issue automagically becomes irrelevant or not actual. It is still actual.

0reactions
semoalcommented, Sep 20, 2022

This won’t get done ever. We use babel-plugin-macros for extracting the t``. Until SWC opens a way to interact with the AST code we CAN’T do nothing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

lingui/js-lingui - Gitter
Hi all, I'm trying to get Lingui working in a new project again, but keep running into @lingui/macro: Cannot read property 'attributes' of...
Read more >
Error with babel-macros when create npm package
But, if I install the library and use on my project shows the next error: MacroError: The macro you imported from "undefined" is...
Read more >
@lingui/babel-plugin-transform-js | Yarn - Package Manager
@lingui/babel-plugin-transform-js. Babel plugin which transforms messages written using lingui-i18n functions to static ICU MessageFormat.
Read more >
Tutorial - Internationalization of React apps - LinguiJS - JS.ORG
Follow setup guide either for projects using LinguiJS with Create React App or for ... If you're wondering what Babel macros are and...
Read more >
How to set up internationalization in React using Lingui.js
Here's how to integrate Lingui.js with a React app and add internationalization capabilities to your application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found