nbfontana / ngx-currency

Currency mask module for Angular 📦
https://nbfontana.github.io/ngx-currency
MIT License
237 stars 122 forks source link

Module not found: Error: Can't resolve 'ngx-currency' in #65

Closed iCodr8 closed 4 years ago

iCodr8 commented 4 years ago

I have updated to Angular 8.2.14 and ngx-currency 2.2.0 and I got the following error:

ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve 'ngx-currency' in '/path-to-project'

Usage:

import { NgxCurrencyModule } from 'ngx-currency';

@NgModule({
  imports: [
    ...
    NgxCurrencyModule,
    ...
  ],
})
export class AppModule {
}

The module exists in the node_modules/ngx-currency directory, but I can't get it working again.

Any ideas?

nbfontana commented 4 years ago

Hmmm, I just merged some changes and it may have negative impact somehow. If you use the older version it works? I'll check this

felippeefreire commented 4 years ago

I get this error on angular build:

ERROR in : Unexpected value 'NgxCurrencyModule in /opt/atlassian/pipelines/agent/build/node_modules/ngx-currency/src/currency-mask.module.d.ts' imported by the module 'RoutesModule in /opt/atlassian/pipelines/agent/build/src/app/routes/routes.module.ts'. Please add a @NgModule annotation.

nbfontana commented 4 years ago

The v2.2.0 release is broken.

I'll ask you guys to stick to the older version v.2.0.2 w/ angular7.

Meanwhile I'll rewrite the build system using ng-packagr, test it and make a new breaking changes version.

Ok?

exequiel09 commented 4 years ago

@nbfontana I think the NPM script copyfiles is the culprit here. It overrides the package.json generated by ng-packagr. Also ng-packagr copies in README, LICENSE and CHANGELOG files so there is no more need for the copyfiles script. Removing copyfiles in the release:npm NPM script fixes that.

You can verify that by packaging locally the dist folder generated by the ng-packagr using the command npm pack and install the generated tgz file to an Angular project and it will work.

t2developer commented 4 years ago

broke for me too, I went back to the last version (1.5.2). I'm running angular 8.2.11 and it works.

Let me know when you release a fix.

amirdt22 commented 4 years ago

2.0.2 worked for me on angular 8

Blunderchips commented 4 years ago

Getting the same issue.

Alekzv9 commented 4 years ago

Same issue, as @t2developer suggested I've to use that version and angular 8.2.14.

nbfontana commented 4 years ago

Fixed with a new version: ngx-currency-v2.2.1 :rocket:

Tested with the following setup:

  "dependencies": {
    "@angular/animations": "~8.2.14",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "core-js": "^2.5.4",
    "ngx-currency": "^2.2.1",
    "rxjs": "~6.5.4",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },

Thanks @exequiel09 for pointing the error in the release script in v2.2.0.

:warning: LET ME KNOW IF ANYTHING STILL BROKEN :warning:

Also, if any of you guys want to improve or make some cool changes to ngx-currency, just let me know.

I've been away from Angular for a while...

Thank you all.

Blunderchips commented 4 years ago

The issue seems to be been resolved

iCodr8 commented 4 years ago

Works fine, thank you!

timhilehin1 commented 5 months ago

I am on Angular 17 and using ngx-currency v2.5.3. I keep getting the error "Module '"ngx-currency"' has no exported member 'NgxCurrencyModule'"

Any ideas?

ArtemDintecom commented 5 months ago

@timhilehin1 I think on Angular 17 you should use the corresponding version of ngx-currency 17.0.0. As of ngx-currency 4.0.0 NgxCurrencyModule no longer exists, you can import the NgxCurrencyDirective directly. Here's the full list of changes. More detailed information on how to override settings globally can be found in the Readme.

timhilehin1 commented 5 months ago

Thank you!