question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 13 + ngx-moment 6.0.2: This module is declared with using 'export =

See original GitHub issue

Multiple error in CLI: This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

Problem goes away if allowSyntheticDefaultImports: true in tsconfig.json

Did you search for duplicate issue? [Yes / No] Yes

Please describe the issue and steps to reproduce, preferably with a code sample / plunker:

Angular update till v13.* Ionic update till 6.* ngx-moment update to 6.0.2 ionic serve/build

  • Angular version? 13
  • TypeScript version? 4.5.4
  • moment version? 2.29.1
  • Are you using moment-timezone? No
  • Are you using the angular-cli? Yes
  • Using Rollup/Webpack/System.js/Ionic/similar? Yes, Ionic

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:16
  • Comments:5

github_iconTop GitHub Comments

6reactions
JaxonWrightcommented, Jan 10, 2022

If the maintainer changes import moment from 'moment'; back to import * as moment from 'moment'; then the allowSyntheticDefaultImports flag would not need to be set to true in your tsconfig of the project using the dependency.

4reactions
AravindMakamcommented, Dec 30, 2021

I also faced the same issue with 6.0.2. I think the import statement has been changed to ‘import ‘moment’ from moment;’. Should it be ‘import * as moment from ‘moment’;’? I saw this change while trying between 6.0.1 and 6.0.2.

@vadimwe, Meanwhile, I would advise to switch to 6.0.1 and then try to build the solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngx-moment - npm
Start using ngx-moment in your project by running `npm i ngx-moment`. ... This module works with Angular 7.0.0 and newer.
Read more >
Error during running angular 13 app after migration
In my case it was an angular workspace, where there was a node_modules folder at the root with a node_modules folder in one...
Read more >
type 'modulewithproviders' is not generic - You.com | The search ...
Angular version 9 deprecates use of ModuleWithProviders without an explicitly generic type, where the generic type refers to the type of the NgModule....
Read more >
ngx-moment moment.js pipes for Angular - Otcollect Collections
Ngx -moment moment.js pipes for Angular. This module provides momentjs pipes to Parse, validate, manipulate, and display dates and times in ...
Read more >
Web-UI - Custombike
```javascript // app.module.ts providers: [ { provide: ... plugins in the "scripts" list of your Angular build declaration * To get karma tests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found