You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started integrating Cypress with Docker in the NextJS application, but I could understand the issue I'm facing.
I pulled the Cypress images from the Docker Hub: 13.6.4 and I followed the steps that are mentioned in the documentation:
1. Run Cypress with Single command
docker run -it -v $PWD:/e2e -w /e2e --entrypoint=cypress cypress/included:13.6.4 run --component
It works well without any issue.
2. Create Dockerfile.test
FROM cypress/included:13.6.4WORKDIR /e2eCOPY . .CMD ["run", "--component"]
Then build the image:
The image was created with success.
Then when I ran the container, I got that issue:
My cypress.config.js:
const { defineConfig } = require("cypress")module.exports = defineConfig({retries: {runMode: 2,},component: {devServer: {framework: "next",bundler: "webpack",// webpackConfig: {// mode: "development",// devtool: false,// module: {// rules: [// // application and Cypress files are bundled like React components// // and instrumented using the babel-plugin-istanbul// // (we will filter the code coverage for non-application files later)// {// test: /\.tsx$/,// exclude: /node_modules/,// use: {// loader: "babel-loader",// options: {// presets: ["@babel/preset-env", "@babel/preset-react"],// plugins: [// // we could optionally insert this plugin// // only if the code coverage flag is on// "istanbul",// ],// },// },// },// ],// },// },},// Instrument the codesetupNodeEvents(on, config) {return config},},e2e: {baseUrl: "http://localhost:3000",setupNodeEvents(on, config) {// implement node event listeners here},},video: false,screenshotOnRunFailure: false,})
My next.config.js:
const{ withContentlayer }=require("next-contentlayer")/** @type {import('next').NextConfig} */constnextConfig={output: "standalone",pageExtensions: ["js","jsx","mdx","ts","tsx"],eslint: {// Warning: This allows production builds to successfully complete even if// your project has ESLint errors.ignoreDuringBuilds: true,},}module.exports=withContentlayer(nextConfig)// Injected content via Sentry wizard belowconst{ withSentryConfig }=require("@sentry/nextjs")module.exports=withSentryConfig(module.exports,{// For all available options, see:// https://github.com/getsentry/sentry-webpack-plugin#options// Suppresses source map uploading logs during buildsilent: true,org: "credium",project: "gersthofen-app",},{// For all available options, see:// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/// Upload a larger set of source maps for prettier stack traces (increases build time)widenClientFileUpload: true,// Transpiles SDK to be compatible with IE11 (increases bundle size)transpileClientSDK: true,// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)tunnelRoute: "/monitoring",// Hides source maps from generated client bundleshideSourceMaps: true,// Automatically tree-shake Sentry logger statements to reduce bundle sizedisableLogger: true,})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Everyone,
I started integrating Cypress with Docker in the NextJS application, but I could understand the issue I'm facing.
I pulled the Cypress images from the Docker Hub: 13.6.4 and I followed the steps that are mentioned in the documentation:
1. Run Cypress with Single command
docker run -it -v $PWD:/e2e -w /e2e --entrypoint=cypress cypress/included:13.6.4 run --component
It works well without any issue.
2. Create Dockerfile.test
Then build the image:
The image was created with success.
Then when I ran the container, I got that issue:
My
cypress.config.js
:My
next.config.js
:My
package.json
:Beta Was this translation helpful? Give feedback.
All reactions