-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Can't reexport the named export 'BREAK' from non EcmaScript module (only default export is available) when including aws-amplify - lack of mjs file support #8361
Comments
@DaveClissold Can you provide a full example for how you get this error please? Thanks! |
@jennifer-shehane I have a custom function to login to the AWS Cognito service, which uses the aws-amplify library. import Amplify, { Auth } from 'aws-amplify';
Amplify.configure({
Auth: {
region: Cypress.env('AWS_REGION'),
userPoolId: Cypress.env('AWS_USERPOOLID'),
userPoolWebClientId: Cypress.env('AWS_USERPOOLWEBCLIENTID'),
}
})
export const awsLogin = async () => {
const username = Cypress.env('TEST_USERNAME');
const password = Cypress.env('TEST_PASSWORD')
try
{
const user = await Auth.signIn(username, password);
return user
}
catch (error)
{
console.log('error signing in', error);
}
} Aws-amplify relies on graphql queries, whose library 'very kindly' uses .mjs files. I get the error when launching the test. It fails during the loading of the test |
Same thing here. Also using amplify. |
Same issue when upgrading to Cypress 5 and using amplify |
I can recreate the error when including aws-amplify: Repro
import Amplify from 'aws-amplify'
{
"devDependencies": {
"aws-amplify": "^3.0.24",
"cypress": "5.0.0"
}
} 4.12.1The 5.0.0 |
The code for this is done in cypress-io/cypress#8395, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
Have just upgraded to version 5.0.0 and it looks like there is a webpack config issue, missing *.mjs support, which is causing the @aws-amplify and graphql libraries from compiling. This worked in 4.12.1
aws-amplify/amplify-js#4299
graphql/graphql-js#1272
The text was updated successfully, but these errors were encountered: