Describe the bug
yarn extract errors when using next/babel babel preset and JSX inside .js files.
To Reproduce
Steps to reproduce the behavior, possibly with minimal code sample, e.g:
- Navigate to the
nextjs-babel directory in this repo.
- Create a JSX file with extension
.js
// Button.js
export default function Button() {
return <button>Click me</button>
}
- Run
yarn extract
- You get the following error:
Add @babel/preset-react (https://github.com/babel/babel/tree/main/packages/babel-preset-react) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx) to the 'plugins' section to enable parsing.
✖
Catalog statistics for src/locales/{locale}:
┌──────────┬─────────────┬─────────┐
│ Language │ Total count │ Missing │
└──────────┴─────────────┴─────────┘
(use "yarn extract" to update catalogs with new messages)
(use "yarn compile" to compile catalogs for production)
Expected behavior
yarn extract shouldn't render the
Additional context
Add any other context about the problem here.
Describe the bug
yarn extracterrors when usingnext/babelbabel preset and JSX inside.jsfiles.To Reproduce
Steps to reproduce the behavior, possibly with minimal code sample, e.g:
nextjs-babeldirectory in this repo..jsyarn extractExpected behavior
yarn extractshouldn't render theAdditional context
Add any other context about the problem here.
jsLingui version
lingui --version-4.0.0-next.3
Babel version
npm list @babel/coreext-js-babel@0.1.0
└─┬ @lingui/cli@4.0.0-next.3
└─┬ @babel/core@7.21.3
└─┬ @babel/helper-compilation-targets@7.20.7
└── @babel/core@7.21.3 deduped
Macro support:
I'm using SWC with
@lingui/swc-pluginI'm using Babel with
babel-macro-pluginI'm not using macro
NextJs