Closed sebastianhaberey closed 1 year ago
Awesome! Turns out I had to enable ESM support in my TypeScript project. Thanks for your help!
So I thought I was able to resolve this by setting my TypeScript config to:
"compilerOptions": {
"module": "NodeNext",
and it seemed to work fine. It did compile and the tests were passing. But I am facing an error when building in production mode:
Error: libs/neo/data-access/src/lib/ressourcen/money/money.ts:28:10 - error TS2349: This expression is not callable.
Type '{ default: Constructor; }' has no call signatures.
28 return currency(money.betragInCent, {
~~~~~~~~
libs/neo/data-access/src/lib/ressourcen/money/money.ts:1:1
1 import * as currency from 'currency.js';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Type originates
I am sure this isn't something in currency.js but rather in my Angular / nx configuration. So I'm just leaving this here in case anyone has seen this before.
Angular complains about not being able to optimize currency.js:
I wonder if it would be difficult to move this library to ECMAScript modules?