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

Recent update may have missing type definition? v2.1.3 #39

Open
relentlessricktrinidad opened this issue Oct 24, 2022 · 9 comments
Open

Comments

@relentlessricktrinidad
Copy link

I'll add more details as they come in, but we just tried deploying a recent version of express-jwt which includes this module. Starting about 2hrs the build process started failing.

error TS2688: Cannot find type definition file for 'express-unless'.
The file is in the program because:
Entry point for implicit type library 'express-unless'

@jfromaniello
Copy link
Owner

jfromaniello commented Oct 24, 2022

are you sure is 2.1.3? I added this today,

https://github.com/jfromaniello/express-unless/blob/master/package.json#L18

but I just tried in a new project and works as expected

@relentlessricktrinidad
Copy link
Author

Yup, trying to track it down. We have a combination of things using "express-jwt" version ^7 and they appear to have deployed a new version (7.7.7) that bumped the dependency version for "express-unless" to version "2.1.3". After that bump things started failing. We also just package updated on a project that has "express-jwt" version 6 and we are experiencing the same issue.

@jfromaniello
Copy link
Owner

just in case, make sure you don't have @types/express-unless and @types/express-jwt in your dependency tree as that's no longer required.

Otherwise if you could give me a simple repro that will be great

@StevenSchlotterbeck
Copy link

StevenSchlotterbeck commented Oct 24, 2022

Can confirm we're running into the same thing -- builds failing with error TS2688: Cannot find type definition file for 'express-unless'.

Looks like @types/express-unless is included by @types/express-jwt, which for us is in turn required by jwks-rsa (1.4.0). Going to see if bumping that addresses the issue.

"@types/express-jwt": {
	"version": "0.0.34",
	"resolved": "https://registry.npmjs.org/@types/express-jwt/-/express-jwt-0.0.34.tgz",
	"integrity": "sha512-WR7a8Y7JZqod8lsu7imvLScJHafBhtc01BJc0vVuPVepeCHW9E6tWViqu8kdusU4L2oLpWoxXFwC8DPtdDycuQ==",
	"requires": {
		"@types/express": "*",
		"@types/express-unless": "*"
	}
},

@StevenSchlotterbeck
Copy link

In case this helps anyone else, bumping jwks-rsa to 2.1.5 resolved our issue.

@sebiglesias
Copy link

Having the same error with a previous version of jwks-rsa as mentioned above and created a repository to reproduce the error: https://github.com/sebiglesias/express-unless-type-error

@dlutton
Copy link

dlutton commented Oct 25, 2022

running into the same issue. I worked around this by using an older versions of express-unless and @types/express-unless to my package.json.

@jfromaniello
Copy link
Owner

I think the problem is a combination of this scenario. First the @types/express-jwt package had the following dependencies:

    "dependencies": {
        "@types/express": "*",
        "@types/express-unless": "*"
    },

NOTE: the wildcard

And that DefinitlyTyped gets updated automatically and since yesterday I added the types, a bot deprecated the package. It created a new version of @types/express-unless without types.

Possible solutions

One option is to update jwks-rsa as @StevenSchlotterbeck says.

Anotion option is, if you are on newer versions of npm, you could add this to your package.json:

  "overrides": {
    "@types/express-unless": "0.5.3"
  }

It works in the repro repository of @sebiglesias .

Unfortunately I can't release definititly-typed packages.

@christianmarois
Copy link

Same thing here... I am trying to migrate on a tight schedule, and can't compile right now. jwks-rsa is at 2.1.5
Overriding worked (I am on pnpm)

@syl-oh syl-oh mentioned this issue Mar 14, 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

6 participants