js-lingui: Error: EPERM: operation not permitted, scandir 'C:/$Recycle.Bin/S-1-5-18' when running lingui extract

Describe the bug Running lingui extract results in error

Error: EPERM: operation not permitted, scandir 'C:/$Recycle.Bin/S-1-5-18'

To Reproduce Use next-js example, and run lingui extract

Expected behavior The command should run successfully.

  • jsLingui version 3.0
  • Babel version @babel/core@7.7.7
  • Your Babel config (e.g. .babelrc):
{
    "presets": ["next/babel"],
    "plugins": [
      "macros",
      "jsx-control-statements",
      [
        "import",
        {
          "libraryName": "@geist-ui/react",
          "libraryDirectory": "esm"
        }
      ]
    ]
  }
  

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 28 (24 by maintainers)

Most upvoted comments

Thanks for fixing this, using 3.2.1 it works as expected. (Powershell Core and Ubuntu Bash)

I’d still recommend using rootDir: "./src" — Lingui will check a bunch of very large files (e.g. in ./build or ./dist) otherwise, making things really slow šŸ˜„

Or use the exclude pattern is also an option, glad to help Markus 😃

WITHOUT rootDir: ".", it is using the current working directory as expected šŸ‘

But if I copy the default config from lingui.js.org/ref/conf.html I’d still expect it to work. And I’d expect ā€œ.ā€ to resolve to the current working directory, too 😃

Yes, absolutely, i forgot to add i’m looking to fix that asap.

@semoal could you perhaps post your lingui.config.js?

My current one is

module.exports = {
  catalogs: [
    {
      path: "<rootDir>/locale/{locale}/messages",
      include: ["<rootDir>"],
      exclude: ["**/node_modules/**"],
    },
  ],
  compileNamespace: "cjs",
  extractBabelOptions: {},
  fallbackLocales: {},
  format: "po",
  locales: ["de", "en"],
  orderBy: "messageId",
  pseudoLocale: "",
  rootDir: ".",
  runtimeConfigModule: ["@lingui/core", "i18n"],
  sourceLocale: "en-x-dev",
};

With your config also fails for me on Windows, because rootDir ā€œ.ā€ goes to Windows homespace. Just removing it, works perfect on Powershell and normal cmd

I’m still having this issue using 3.1.0 😦

Windows seems unable to resolve the default rootDir. Using this instead works:

  rootDir: "./src",

Released in 3.0.1. Consider donating using OpenCollective to support development and maintanence of this project šŸ‘