-
Notifications
You must be signed in to change notification settings - Fork 386
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
Latest Docker image not compatible with ESM, failing with "configFile is invalid ... Unexpected identifier 'assert'" #1053
Comments
@philly-vanilly What was the docker-image you were using that was causing the issue? |
|
@philly-vanilly This link 404s for me. Can you point to the tag? https://hub.docker.com/r/cypress/browsers/tags |
I have exactly the same problem with node:latest |
Same for me with node:latest I set it to node:21 and CI has run OK. |
It was the latest tag on April 26 when I created this issue, so I assume it was resolved to node-22.0.0-chrome-124.0.6367.60-1-ff-125.0.2-edge-124.0.2478.51-1 |
I noticed that JSON modules import under ESM is experimental and therefore unstable https://nodejs.org/docs/latest-v20.x/api/documentation.html#stability-index.
|
See https://nodejs.org/docs/latest-v20.x/api/esm.html#import-attributes. You will need to change your code. This isn't a bug in the Cypress Docker images. |
Current behavior
Since yesterday I was getting this error despite not having updated anything in my code:
app-e2e
package in my npm monorepo is using ESM and ESM might have problems importing jsons, egimport foo from './foo.json' assert { type: 'json' };
however, in our own code there were no such imports. I have pinned the version used in bitbucket pipelines to the previous one:
image: cypress/browsers:node-20.12.2-chrome-124.0.6367.60-1-ff-125.0.2-edge-124.0.2478.51-1
and it did the trick. Please fix your docker images and make them ESM compatible again.
Desired behavior
No response
Test code to reproduce
package.json:
Cypress Version
cypress-13.6.6.tgz
Node version
20.11.0
Operating System
linux, specifics you should know better whatever is used in cypress/browser docker image
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: