"export 'resize' was not found in '@engineers/graphics/index'

35 views Asked by At

I got "export 'resize' was not found in '@engineers/graphics'

graphics.ts

https://github.com/eng-dibo/ngx/blob/master/packages/graphics/index.ts#L33

export type Img = string | Buffer | Sharp;
export type Size = number | string | null;
/**
 * [resize description]
 * @method resize
 * @param  {Img} img     file path or image buffer;
 * @param  {Size | Size[]} size    width or [width, height] or 'width,height', if size=null just convert img type
 * @param  {[type]} options [description]
 * @return Promise<info>
 *
 * todo:
 *  - rename size to dimensions
 *  - convert(img) = resize(img,size=null,{output=type})
 */
export function resize(
  img: Img,
  size: Size | Size[],
  options: ResizeOptions = {}
): Promise<any> {}

in other file:

https://github.com/eng-dibo/ngx/blob/master/projects/cms/server/api/v1.ts#L12

import { resize } from "@engineers/graphics/index";
1

There are 1 answers

0
Sherif eldeeb On

solved by fixing package.json/name field. for some reason (I don't know why) the package name of this package is identical to another package in the same folder, so require('path/to/graphic/package') loads the other package, even it require it by path not by name like require('package-name')