express-unless icon indicating copy to clipboard operation
express-unless copied to clipboard

Recent update may have missing type definition? v2.1.3

Open relentlessricktrinidad opened this issue 3 years ago • 9 comments

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'

relentlessricktrinidad avatar Oct 24 '22 18:10 relentlessricktrinidad

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

jfromaniello avatar Oct 24 '22 18:10 jfromaniello

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.

relentlessricktrinidad avatar Oct 24 '22 18:10 relentlessricktrinidad

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

jfromaniello avatar Oct 24 '22 18:10 jfromaniello

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 avatar Oct 24 '22 20:10 StevenSchlotterbeck

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

StevenSchlotterbeck avatar Oct 24 '22 21:10 StevenSchlotterbeck

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

sebiglesias avatar Oct 24 '22 21:10 sebiglesias

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.

dlutton avatar Oct 25 '22 00:10 dlutton

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.

jfromaniello avatar Oct 25 '22 13:10 jfromaniello

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)

christianmarois avatar Oct 26 '22 19:10 christianmarois