-
Notifications
You must be signed in to change notification settings - Fork 0
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
TypeError: generateLogin is not a function #5
Comments
... |
Hi! This fell through the cracks, sorry. We did some work back in February to ensure this package worked with cypress v10. I'm surprised seeing it at v13 already, and we haven't kept up internally. I will try to see if I can find some time to debug this, but I can't promise anything. I'm also not sure if this works with the newest versions of In the meantime if you want to debug further yourself you could try to copy the two files from src/ into your project and see if you get some more info on why it doesn't work. |
I just ran into this myself actually. Some weirdness going on with the modules/commonjs and import/require. I had to import it like this to resolve it: import generateLoginRaw from '@intility/cypress-msal'
import keyVaultCacheRaw from '@intility/msal-keyvault-cache'
const generateLogin =
'default' in generateLoginRaw &&
typeof generateLoginRaw?.default === 'function'
? generateLoginRaw.default
: generateLoginRaw
const keyVaultCache =
'default' in keyVaultCacheRaw &&
typeof keyVaultCacheRaw?.default === 'function'
? keyVaultCacheRaw.default
: keyVaultCacheRaw Next time I update this package, I think I will change it to output es modules instead of commonjs. Although that will be a breaking change and I'm not sure when I'll have time to do that. |
This doesn't work for me.
|
I got same problem , help me pls . I'm gonna be lay-off |
I decided not to use the library but create a test user in AD, and follow the cypress doc about Azure login. https://docs.cypress.io/guides/end-to-end-testing/azure-active-directory-authentication create a test user in AD, and use that as credentials. |
Do you have solution yet ? |
i did this way but it not solve my problem in project |
Since there is an official guide, I'm considering deprecating this package, as we've moved away from cypress. There might be cases with conditional access that wouldn't work though. Those would still would need ROPC flow, or then more preferably, Device Code flow, which this library has been aimed at. Since I'm not actively in-the-loop of how the newest cypress works, I'd gladly take some help getting this to support the current version(s), if anyone is in need of this. The flow of the package itself is pretty straight forward:
But how to do each step with cypress seem to change every other week. They have a sample with ROPC flow and Playwright for reference in the msal repo https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/TestingSample/test/browser-test.spec.ts |
When following the README, Cypress@13.1.0 throws a TypeError.
Your configFile is invalid: /Users/.../.../cypress.config.ts
My cypress.config.ts:
The text was updated successfully, but these errors were encountered: