Comments (10)
Nevermind, I have to add the "transform-object-rest-spread" plugin ...
from js-lingui.
Ah, you're right! That plugin isn't part of env
preset! Good job! 👍
Thank you for reporting the bug with ignore patterns. I'll fix it soon.
from js-lingui.
Hello @herzaso,
there's already srcPathIgnorePatterns
configuration (https://lingui.gitbooks.io/js/ref/cli.html), but the default value is /node_modules/
so I wonder, why it tries to extract messages from node_modules.
I'm not familiar with react-app-rewired
, I'll take a look.
from js-lingui.
It may be caused that /node_modules/
isn't treated correctly as a regexp, but rather unix-style directory, while you're on windows so it doesn't match. Just my first guess.
Could you please try to add this section to your package.json
to verify it?
{
"lingui": {
"srcPathIgnorePatterns": ["node_modules"]
}
}
from js-lingui.
@tricoder42 you are right, it was caused by the wrong path delimiter (maybe consider changing the regexp to support windows delimiter also).
Other than that, I know have another problem:
C:\Users\ofirhe\AppData\Local\Yarn\config\global\node_modules\babel-core\lib\transformation\file\index.js:590
throw err;
^
SyntaxError: C:/Development/partner_portal/client/src/components/Form/Form.js: Unexpected token (41:10)
39 | uiSchema = Object.assign(uiSchema, schema.uiSchema)
40 |
> 41 | return {...schema, uiSchema}
| ^
42 | }
43 |
from js-lingui.
Do I understand it correctly, that you actually have this .babelrc
in root of your repository?
{
"plugins": [
"syntax-dynamic-import"
],
"env": {
"test": {
"plugins": [
"dynamic-import-node"
]
}
},
"presets": [
"env",
"react",
"lingui-react"
]
}
All what you do in config-overrides.js
is to tell webpack to use .babelrc
, right? (babelLoader.options.babelrc = true;
)
from js-lingui.
Yes. I have added the es2015
preset just to make sure (although create-react-app should have it by default), but the result is the same
from js-lingui.
It should be fixed on latest release of [email protected]
. Could you please confirm it? Simply remove srcPathIgnorePatterns
to test the default works correctly.
from js-lingui.
Running the cli did produce the table with number of labels although it didn't show any file being collected (whereas before it did log the file paths that were collected).
Since I wasn't sure, I removed the locale directory and ran lingui add-locale en
, but got the following error:
fs.js:641
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'C:\Development\partner_portal\client\locale\en\messages.json'
at Error (native)
at Object.fs.openSync (fs.js:641:18)
at Object.fs.writeFileSync (fs.js:1347:33)
at Object.write (C:\Users\ofirhe\AppData\Roaming\npm\node_modules\lingui-cli\dist\api\formats\lingui.js:60:20)
at Object.addLocale (C:\Users\ofirhe\AppData\Roaming\npm\node_modules\lingui-cli\dist\api\formats\lingui.js:167:14)
at C:\Users\ofirhe\AppData\Roaming\npm\node_modules\lingui-cli\dist\lingui-add-locale.js:29:36
at Array.map (native)
at command (C:\Users\ofirhe\AppData\Roaming\npm\node_modules\lingui-cli\dist\lingui-add-locale.js:28:25)
at Object.<anonymous> (C:\Users\ofirhe\AppData\Roaming\npm\node_modules\lingui-cli\dist\lingui-add-locale.js:67:3)
at Module._compile (module.js:570:32)
from js-lingui.
I made the output more silent. Running lingui extract --verbose
gives the full output as before.
The error is, however, weird. I'll take a look
from js-lingui.
Related Issues (20)
- Missing auto-generated `id` for `<Trans>` macro when using Typescript HOT 4
- ERROR in ./node_modules/@lingui/macro/dist/index.mjs 347:24 Module parse failed HOT 7
- a special message cant compile. HOT 1
- `lingui` can be null HOT 2
- Compile messages to JSON HOT 5
- Support Gatsby HOT 2
- Cannot find type definition file for './node_modules/@lingui/macro/global'. HOT 2
- Next.js tutorial HOT 3
- The `catalogsMergePath` option is missing in the documentation
- Support backup messages HOT 3
- Extract removes manual comments from po files HOT 1
- React Fragment (`<>`) inside `<Plural>` is not working HOT 5
- Impossible to use with Vite? HOT 1
- definePlural macro HOT 4
- rspack now supports wasm plugins, lingui integration example could be improved HOT 3
- Escaped curly-braces doesn't preserve in development mode HOT 1
- <Trans> breaks React JSX semantics with regards to booleans HOT 3
- Consider renaming of the macro components HOT 2
- selectOrdinal error HOT 2
- Lingui CLI extraction puts msgid as msgstr HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-lingui.