Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find name '.....' in typescript files #645

Closed
Jeroen-Cox opened this issue Mar 31, 2023 · 1 comment
Closed

Cannot find name '.....' in typescript files #645

Jeroen-Cox opened this issue Mar 31, 2023 · 1 comment

Comments

@Jeroen-Cox
Copy link

Describe the bug

When building my Vue project including this library I get errors during the build:

` 4 | */
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts(1,47):
1:47 Cannot find name 'from'.

1 | import type { CurrentValues, PanzoomOptions } from './types';
| ^
2 | /**
3 | * Gets a style value expected to be a number
4 | /
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts(14,80):
14:80 Cannot find name 'PanzoomOptions'.
12 | * and takes care of prefixing the transition and transform
13 | /
14 | export declare function setTransition(elem: HTMLElement | SVGElement, options: PanzoomOptions): void;
| ^
15 | /

16 | * Set the transform using the proper prefix
17 | *
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts(34,94):
34:94 Cannot find name 'CurrentValues'.
32 | * 33 | */ 34 | export declare function setTransform(elem: HTMLElement | SVGElement, { x, y, scale, isSVG }: CurrentValues, _options?: PanzoomOptions): void; | ^ 35 | /** 36 | * Dimensions used in containment and focal point zooming 37 | */ ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/css.d.ts(34,120): 34:120 Cannot find name 'PanzoomOptions'. 32 | *
33 | /
34 | export declare function setTransform(elem: HTMLElement | SVGElement, { x, y, scale, isSVG }: CurrentValues, _options?: PanzoomOptions): void;
| ^
35 | /
*
36 | * Dimensions used in containment and focal point zooming
37 | */
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(11,15):
11:15 Cannot find name 'PanzoomObject'.
9 | */
10 | import './polyfills';
11 | import type { PanzoomObject, PanzoomOptions } from './types';
| ^
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(11,15):
11:15 Left side of comma operator is unused and has no side effects.
9 | */
10 | import './polyfills';
11 | import type { PanzoomObject, PanzoomOptions } from './types';
| ^
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(11,30):
11:30 Cannot find name 'PanzoomOptions'.
9 | */
10 | import './polyfills';
11 | import type { PanzoomObject, PanzoomOptions } from './types';
| ^
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(11,47):
11:47 Cannot find name 'from'.
9 | */
10 | import './polyfills';
11 | import type { PanzoomObject, PanzoomOptions } from './types';
| ^
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(12,73):
12:73 Cannot find name 'PanzoomOptions'.
10 | import './polyfills';
11 | import type { PanzoomObject, PanzoomOptions } from './types';
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
| ^
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
15 | }
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(12,100):
12:100 Cannot find name 'PanzoomObject'.
10 | import './polyfills';
11 | import type { PanzoomObject, PanzoomOptions } from './types';
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
| ^
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
15 | }
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts
ERROR in /home/node/app/node_modules/@panzoom/panzoom/dist/src/panzoom.d.ts(14,25):
14:25 Cannot find name 'PanzoomOptions'.
12 | declare function Panzoom(elem: HTMLElement | SVGElement, options?: Omit<PanzoomOptions, 'force'>): PanzoomObject;
13 | declare namespace Panzoom {
14 | var defaultOptions: PanzoomOptions;
| ^
15 | }
16 | export * from './types';
17 | export default Panzoom;`

Your environment

  • Version of panzoom: 4.5.1

Steps to reproduce

Create a Vue project and include panzoom library. Try to build the project.

@timmywil
Copy link
Owner

Thanks for opening an issue. It looks like your vue project is importing the types, but does not support import in those types. This can happen sometimes depending on your project setup, but is not something Panzoom can fix for you. It's likely a setting you can change, either in TS config, vue config, or something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants