Git Product home page Git Product logo

Comments (10)

herzaso avatar herzaso commented on May 18, 2024 1

Nevermind, I have to add the "transform-object-rest-spread" plugin ...

from js-lingui.

tricoder42 avatar tricoder42 commented on May 18, 2024 1

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.

tricoder42 avatar tricoder42 commented on May 18, 2024

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.

tricoder42 avatar tricoder42 commented on May 18, 2024

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.

herzaso avatar herzaso commented on May 18, 2024

@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.

tricoder42 avatar tricoder42 commented on May 18, 2024

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.

herzaso avatar herzaso commented on May 18, 2024

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.

tricoder42 avatar tricoder42 commented on May 18, 2024

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.

herzaso avatar herzaso commented on May 18, 2024

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.

tricoder42 avatar tricoder42 commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.