You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running ng-packagr and trying to include moment, I get the following error:
BUILD ERROR
Cannot call a namespace ('moment')
Error: Cannot call a namespace ('moment')
How To Reproduce
Create a component/pipe that needs moment, and import it. In a normal Angular app, you would use it by doing this: import * as moment from 'moment';, but that doesn't fly when packaging the library. I changed the tsconfig.json to allowSyntheticDefaultImports but the same error occurs.
Expected Behaviour
The package should be packaged up just fine with ng-packagr, including if it has moment included.
Hi @plambhsa, yes, can you please check the other issues if they solve your situation? Should there still be issues/questions, please comment and re-open!
Type of Issue
Description
When running ng-packagr and trying to include moment, I get the following error:
How To Reproduce
Create a component/pipe that needs moment, and import it. In a normal Angular app, you would use it by doing this:
import * as moment from 'moment';
, but that doesn't fly when packaging the library. I changed the tsconfig.json toallowSyntheticDefaultImports
but the same error occurs.Expected Behaviour
The package should be packaged up just fine with ng-packagr, including if it has moment included.
Version Information
The moment library I'm using is 2.19.1. I also tried using moment-es6 at version 1.0.0.
The text was updated successfully, but these errors were encountered: