mammadataei / cypress-vite

Run Cypress specs using Vite
MIT License
85 stars 10 forks source link

The "original" argument must be of type Function #86

Closed willisfed closed 5 months ago

willisfed commented 9 months ago

I seem to be running into an issue when adding cypress-vite to my cypress.config.ts.

I get an error thrown in cypress

`The following error originated from your test code, not from Cypress.

The "original" argument must be of type Function

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.`
import vitePreprocessor from 'cypress-vite';
import { defineConfig } from 'cypress';
import { createRequire } from 'module';
import axios from 'axios';
const require = createRequire(import.meta.url);

export default defineConfig({
  env: {
    codeCoverage: {
      exclude: 'cypress/**/*.*',
    },
  },
  chromeWebSecurity: false,
  blockHosts: [],
  e2e: {
    baseUrl: 'http://localhost:3001',
    setupNodeEvents(on, config) {
      require('@cypress/code-coverage/task')(on, config);
      on('file:preprocessor', vitePreprocessor());

      return config;
    },
    defaultCommandTimeout: 30000,
  },
});

Cypress version: 12.17.2 Vite: 4.3.9

mammadataei commented 7 months ago

I'm not sure if this is related to the cypress-vite since The following error originated from your test code, not from Cypress. Try to run cypress-vite in debug mode; it will show if something goes wrong during the compilation process.

github-actions[bot] commented 6 months ago

This issue is automatically marked as stale because it has been open for 30 days with no activity. Remove the stale label or leave a comment, or it will be closed in 14 days.

github-actions[bot] commented 5 months ago

This issue was closed because it has been stalled for 14 days with no activity. Please feel free to open a new issue if you have any further questions.