Hello, I am new to using Cypress so please bear with me if this seems like a trivial issue. Below you will find my cypress.config.ts file where I am attempting to integrate the cypress esbuild preprocessor into the configuration.
import cypress_esbuild_preprocessor from '@bahmutov/cypress-esbuild-preprocessor';
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
setupNodeEvents(on) {
on(
'file:preprocessor',
cypress_esbuild_preprocessor(),
);
},
},
});
When I run Cypress, I encounter the following configuration error in the console-
TypeError: (0 , cypress_esbuild_preprocessor_1.default) is not a function
I found that it works fine if I create cypress_esbuild_preprocessor as a const like this-
const cypress_esbuild_preprocessor = require('@bahmutov/cypress-esbuild-preprocessor');
Since I am using TypeScript for coding, I prefer to import the plugin rather than use it as a const. The version of Cypress I am using is 12.17.1. Any thoughts on this would be greatly appreciated. Thank you!