biesbjerg / ngx-translate-extract

Extract translatable (using ngx-translate) strings and save as a JSON or Gettext pot file
MIT License
525 stars 198 forks source link

Angular 13 issue #246

Open tarlepp opened 2 years ago

tarlepp commented 2 years ago

After I upgraded Angular from 12 to 13 I got following error:

yarn run v1.22.15
$ ngx-translate-extract --input ./src --output ./src/assets/i18n/*.json --clean --format-indentation '  ' --sort --format namespaced-json --null-as-default-value && for files in src/assets/i18n/*.json; do echo >> $files; done;
node:internal/modules/cjs/loader:979
    throw new ERR_REQUIRE_ESM(filename, true);
    ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/@angular/compiler/fesm2015/compiler.mjs not supported.
Instead change the require of /app/node_modules/@angular/compiler/fesm2015/compiler.mjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/app/node_modules/@biesbjerg/ngx-translate-extract/dist/parsers/pipe.parser.js:3:20)
    at Object.<anonymous> (/app/node_modules/@biesbjerg/ngx-translate-extract/dist/cli/cli.js:6:23)
    at Object.<anonymous> (/app/node_modules/@biesbjerg/ngx-translate-extract/bin/cli.js:3:1) {
  code: 'ERR_REQUIRE_ESM'
}
error Command failed with exit code 1.

Any idea how to fix this?

michaelbromley commented 1 year ago

Hi everyone,

Thanks for your patience! I've now set up a fork: https://github.com/vendure-ecommerce/ngx-translate-extract

and published the first release under the new org:

npm i @vendure/ngx-translate-extract

v8.0.3 is the first version, and nothing has changed apart from references in the readme & package.json.

Thank you @biesbjerg for all the work you put in to this up till now, and for @bartholomej for keeping us all rolling for the past year or so. Bart I invited you to the repo with write access 👍

I'm not planning to go through all the issues & PRs in this repo, but I welcome issues & PRs on the new fork repo.