Im setting up cypress with cucumber along with htt...
# help
p
Im setting up cypress with cucumber along with https://github.com/badeball/cypress-cucumber-preprocessor and bundler https://github.com/badeball/cypress-cucumber-preprocessor/tree/master/examples/esbuild-ts And I keep getting this error not sure what to do * - hidden path
Copy code
Your configFile is invalid: ***/cypress.config.ts
It threw an error when required, check the stack trace below:
Error: Cannot find module 'esbuild'
Require stack:
- /builds/***/node_modules/@bahmutov/cypress-esbuild-preprocessor/src/index.js
- /builds/A7ZaeUHb/0/gog-QA/e2e-finapp-sales-summary/cypress.config.ts
- /root/.cache/Cypress/10.2.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js
.
.
.
my cypress config
Copy code
import { defineConfig } from "cypress";
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import createEsbuildPlugin from "@badeball/cypress-cucumber-preprocessor/esbuild";

async function setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions): Promise<Cypress.PluginConfigOptions> {
  await addCucumberPreprocessorPlugin(on, config);

  on(
    "file:preprocessor",
    createBundler({
      plugins: [createEsbuildPlugin(config)],
    })
  );

  // Make sure to return the config object as it might have been modified by the plugin.
  return config;
}

export default defineConfig({
  e2e: {
    specPattern: "**/*.feature",
    supportFile: false,
    baseUrl: "https://finapp.gog-staging.com",
    setupNodeEvents,
    retries: {
      runMode: 2,
      openMode: 0
    }
  },
});
my cypress config
Copy code
import { defineConfig } from "cypress";
import createBundler from "@bahmutov#6775/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball#5954/cypress-cucumber-preprocessor";
import createEsbuildPlugin from "@badeball#5954/cypress-cucumber-preprocessor/esbuild";

async function setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions): Promise<Cypress.PluginConfigOptions> {
  await addCucumberPreprocessorPlugin(on, config);

  on(
    "file:preprocessor",
    createBundler({
      plugins: [createEsbuildPlugin(config)],
    })
  );

  // Make sure to return the config object as it might have been modified by the plugin.
  return config;
}

export default defineConfig({
  e2e: {
    specPattern: "**/*.feature",
    supportFile: false,
    baseUrl: "https://finapp.gog-staging.com",
    setupNodeEvents,
    retries: {
      runMode: 2,
      openMode: 0
    }
  },
});
2 Views