Skip to content

packages/verify/lib/interfaces/VerifyControlError.ts contains a broken import path #800

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

Closed
duckdotapk opened this issue Mar 1, 2023 · 5 comments

Comments

@duckdotapk
Copy link

duckdotapk commented Mar 1, 2023

Expected Behavior

This file should import the CheckStatus enum as follows:

import { CheckStatus } from "../enums/index";

Current Behavior

Instead, it currently imports it by going up too many directories, out of the lib folder and then back into it:

import { CheckStatus } from '../../lib/enums/index';

This confuses the TypeScript compiler and causes an error when attempting to use the package because the lib folder is not included in the package on NPM:

[11:15:26 AM] Starting compilation in watch mode...

node_modules/@vonage/verify/dist/interfaces/VerifyControlError.d.ts:1:29 - error TS2307: Cannot find module '../../lib/enums/index' or its corresponding type declarations.

1 import { CheckStatus } from '../../lib/enums/index';
                              ~~~~~~~~~~~~~~~~~~~~~~~

[11:15:33 AM] Found 1 error. Watching for file changes.

Possible Solution

See "Expected behaviour" above.

It is correct for this package to not include the lib folder, of course, and I believe correcting the path should cause the TSC to not try to looking there like it does right now.

Steps to Reproduce (for bugs)

Attempt to compile TypeScript code that imports from a Vonage package which imports this script.

I am not sure which script in my project is causing this to get included as I do not have a direct dependency on @vonage/verify, instead another Vonage module is depending on it.

Context

It just simply causes an error in the TypeScript compilation step which is not ideal.

Your Environment

@manchuck
Copy link
Contributor

manchuck commented Mar 6, 2023

@duckdotapk Can you also pass along which version of @vonage/verify you are using (npm ls @vonage/verify)? There were some import issues with one of the versions published recently. I thought I got them all but some might have slipped though

@duckdotapk
Copy link
Author

duckdotapk commented Mar 6, 2023

@manchuck Sure, here is that information:

`-- @vonage/[email protected]
  `-- @vonage/[email protected]

Edit: Note that I updated some Vonage packages since my initial message so this server-sdk version is slightly different than before. The issue is still there though.

@manchuck
Copy link
Contributor

manchuck commented Mar 6, 2023

@duckdotapk, thanks for that. I found the issue and opened PR #803

Sorry for the lousy refractor.

@duckdotapk
Copy link
Author

No worries, it happens! I appreciate the incoming fix.

@manchuck
Copy link
Contributor

manchuck commented Mar 6, 2023

Fixed in 1.1.2 https://www.npmjs.com/package/@vonage/verify/v/1.1.2

@manchuck manchuck closed this as completed Mar 6, 2023
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