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

[BUG] No exported member #475

Closed
mrosendin opened this issue Oct 29, 2020 · 13 comments
Closed

[BUG] No exported member #475

mrosendin opened this issue Oct 29, 2020 · 13 comments
Assignees
Labels

Comments

@mrosendin
Copy link

"passport-saml": "^1.3.5" in package.json (which installs 1.4.0)

Running yarn run build on my system returned this error:

SFO-X74WCJ-M:provisioning-api mrosendin$ yarn run build
yarn run v1.22.4
$ npm-run-all clean tsc copy-assets
$ rm -r dist || true
rm: dist: No such file or directory
$ tsc
src/config/passport.ts:3:10 - error TS2305: Module '"../../node_modules/passport-saml/lib/passport-saml"' has no exported member 'Profile'.

3 import { Profile, Strategy as SamlStrategy, VerifiedCallback } from 'passport-saml';
           ~~~~~~~

src/config/passport.ts:3:45 - error TS2305: Module '"../../node_modules/passport-saml/lib/passport-saml"' has no exported member 'VerifiedCallback'.

3 import { Profile, Strategy as SamlStrategy, VerifiedCallback } from 'passport-saml';
                                              ~~~~~~~~~~~~~~~~

src/config/passport.ts:10:5 - error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.

 10     new SamlStrategy(
        ~~~~~~~~~~~~~~~~~
 11       {
    ~~~~~~~
...
 28       }
    ~~~~~~~
 29     )
    ~~~~~


Found 3 errors.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "tsc" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

  • Node.js version: v14.5.0
  • passport-saml version: 1.4.0
  • tsc version: 3.3.3333
@mrosendin mrosendin added the bug label Oct 29, 2020
@mrosendin mrosendin changed the title [BUG] [BUG] No exported member Oct 29, 2020
@gugu
Copy link
Contributor

gugu commented Oct 29, 2020

I'll take it

@felipefadoni
Copy link

I'm in the same trouble.

@gugu gugu closed this as completed in bd4bc79 Oct 29, 2020
@gugu gugu reopened this Oct 29, 2020
@gugu
Copy link
Contributor

gugu commented Oct 29, 2020

The fix is in master. Can you please update package.json in the dev environment to git+https://github.com/node-saml/passport-saml.git and confirm it works now? @felipefadoni @mrosendin

@felipefadoni
Copy link

@gugu Gugu, it worked here.

@felipefadoni
Copy link

@gugu Thank you very much for the agility in solving the bug. We were here killing ourselves to solve, kkkkkkkk

@gugu
Copy link
Contributor

gugu commented Oct 29, 2020

Great. @markstos, we need v1.4.1 :)

@gugu
Copy link
Contributor

gugu commented Oct 29, 2020

@gugu Thank you very much for the agility in solving the bug. We were here killing ourselves to solve, kkkkkkkk

It was me who introduced the bug :)

@cjbarth
Copy link
Collaborator

cjbarth commented Oct 29, 2020

@gugu is there something we need to do to the GitHub Actions/build to be able to catch a problem like this in the future?

@gugu
Copy link
Contributor

gugu commented Oct 29, 2020

after we update tests to typescript they will test types as well

@markstos
Copy link
Contributor

Thanks. Releasing soon.

@markstos
Copy link
Contributor

Fixed in v1.4.1.

@avilashchoudhary6681
Copy link

avilashchoudhary6681 commented Oct 30, 2020

@gugu The type definition file for multiSamlStrategy.d.ts is empty. so we are using @types/passport-saml. There is some inconsistency in type definition for getAssertion method in Profile between this package and @types/passport-saml.

getAssertion(): object
getAssertion(): Record<string, unknown>
passport-saml: 1.4.2

Please check this error

`Argument of type '(req: express.Request, profile: Profile, done: VerifiedCallback) => void' is not assignable to parameter of type 'VerifyWithRequest | VerifyWithoutRequest'.
Type '(req: express.Request, profile: Profile, done: VerifiedCallback) => void' is not assignable to type 'VerifyWithRequest'.
Types of parameters 'profile' and 'profile' are incompatible.
Type 'import("/Projects/node-commons/node_modules/@types/passport-saml/index").Profile' is not assignable to type 'import("/Projects/node-commons/node_modules/passport-saml/lib/passport-saml/types").Profile'.
Type 'Profile' is not assignable to type '{ issuer?: string | undefined; sessionIndex?: string | undefined; nameID?: string | undefined; nameIDFormat?: string | undefined; nameQualifier?: string | undefined; spNameQualifier?: string | undefined; ... 5 more ...; getSamlResponseXml(): string; }'.
The types returned by 'getAssertion()' are incompatible between these types.
Type 'object' is not assignable to type 'Record<string, unknown>'.
Index signature is missing in type '{}'.

78 (req: express.Request, profile: Profile, done: VerifiedCallback) => {
`

@cjbarth
Copy link
Collaborator

cjbarth commented Apr 6, 2021

@gugu , can this be closed?

@avilashchoudhary6681, @borisbc, @amerblackbird: do you still have this issue even on the 2.x branch?

@cjbarth cjbarth closed this as completed Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants