ngx-jsonapi icon indicating copy to clipboard operation
ngx-jsonapi copied to clipboard

Module not found: Error: Can't resolve 'faker'

Open ZeevKatz opened this issue 5 years ago • 5 comments

After the last version update (2.1.14), I'm receiving an error about faker.

Here is the exception:

ERROR in <path>/node_modules/ngx-jsonapi/ngx-jsonapi/@ngx-jsonapi/ngx-jsonapi.js
Module not found: Error: Can't resolve 'faker' in '<path>/node_modules/ngx-jsonapi/ngx-jsonapi/@ngx-jsonapi'

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.20
Node: 12.13.1
OS: darwin x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.803.20
@angular-devkit/build-angular      0.803.20
@angular-devkit/build-ng-packagr   0.803.20
@angular-devkit/build-optimizer    0.803.20
@angular-devkit/core               8.3.20
@angular-devkit/schematics         8.3.20
@angular/cdk                       8.2.3
@angular/cli                       8.3.20
@angular/flex-layout               8.0.0-beta.27
@angular/localize                  9.0.0-rc.0
@schematics/angular                8.3.20
@schematics/update                 0.803.20
ng-packagr                         5.7.1
rxjs                               6.5.3
typescript                         3.4.5
webpack                            4.41.3

ZeevKatz avatar Dec 19 '19 08:12 ZeevKatz

Yeah, I am experiencing this as well. Looks like the latest release (Not shown in releases tab) has the export of the test factory which relies on faker in the DEV dependency bundle.

https://github.com/reyesoft/ngx-jsonapi/blob/2703fd23bdd2380feffe9888ded66a7a5dac7422/src/public_api.ts

I am curious as to why ANY of the test modules are being included in the public api definition.

I am assuming this was a mistake. I had to move back to 2.1.12 for this library to work with Angular 8 in the mean time.

iamchrismiller avatar Jan 07 '20 20:01 iamchrismiller

We exported the test modules so we can use them to test other apps... I'll try to export the test modules separately to avoid this issue. Thanks for reporting!

maxi7587 avatar Jan 13 '20 19:01 maxi7587

2.1.15 - the issue is still present

ivelichko avatar Jan 21 '20 21:01 ivelichko

Confirmed - also on v2.1.15 with this issue.

ap1969 avatar Jan 24 '20 09:01 ap1969

Still seeing this as well - 2.1.15

Temp workaround in local dev has been to save faker as a dev dependency.

CapturedMomentum avatar Apr 25 '20 20:04 CapturedMomentum