When attempting to utilize ngx-translate with the .po loader, a warning is triggered during compile time:
WARNING in ./node_modules/encoding/lib/iconv-loader.js 9:12-34
Critical dependency: the request of a dependency is an expression
The warning specifically points to this line of code:
const po = gettext.po.parse(contents, 'utf-8');
Upon runtime, an error is encountered causing the application to fail:
index.js:43 Uncaught ReferenceError: global is not defined
at Object../node_modules/buffer/index.js (index.js:43)
at __webpack_require__ (bootstrap:79)
at Object../node_modules/iconv-lite/lib/index.js (index.js:5)
at __webpack_require__ (bootstrap:79)
at Object../node_modules/encoding/lib/encoding.js (encoding.js:3)
at __webpack_require__ (bootstrap:79)
at Object../node_modules/gettext-parser/lib/poparser.js (poparser.js:1)
at __webpack_require__ (bootstrap:79)
at Object../node_modules/gettext-parser/index.js (index.js:1)
at __webpack_require__ (bootstrap:79)
Despite searching online and on stack overflow, a solution to this issue remains elusive.
Are there any alternatives to gettext for parsing .po files, or is there a way to resolve this and make it work?