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
Error: Webpack Compilation Error
./node_modules/graphql/index.mjs 49:0-53:205
Can't reexport the named export 'BREAK' from non EcmaScript module (only default export is available)
@ ./node_modules/@aws-amplify/pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider.js
@ ./node_modules/@aws-amplify/pubsub/lib-esm/Providers/index.js
@ ./node_modules/@aws-amplify/pubsub/lib-esm/index.js
@ ./node_modules/aws-amplify/lib-esm/index.js
@ ./cypress/support/custom/userLogin.ts
@ ./cypress/support/custom/index.ts
@ ./cypress/support/commands.ts
@ ./cypress/support/index.ts
鈹咺ssue is synchronized with this Jira Features by Unito
@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:
cypress/support/index.js
import Amplify from 'aws-amplify'
package.json
{
"devDependencies": {
"aws-amplify": "^3.0.24",
"cypress": "5.0.0"
}
}
The aws-amplify takes a really long time to load normally. see https://github.com/cypress-io/cypress/issues/7464


The code for this is done in cypress-io/cypress#8395, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Released in 5.1.0.
This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.1.0, please open a new issue.
Most helpful comment
@jennifer-shehane I have a custom function to login to the AWS Cognito service, which uses the aws-amplify library.
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