Skip to content

After integrating Cypress code coverage into Nuxt3, the app is not working properly #613

Closed
@belwalshubham

Description

@belwalshubham

I'm using the Vite Istanbul plugin to integrate cypress code coverage into my nuxt3 app. I'm getting the code coverage report, but my Nuxt3 app is not being compiled and is not functioning properly.
In our most recent version, we have the following code inside the Vite-Plugin-Istanbul folder:

transform(srcCode, id, options) {
      if (!enabled || options?.ssr || id.startsWith(MODULE_PREFIX) || id.startsWith(NULL_STRING)) {
        return;
      }
      if (testExclude.shouldInstrument(id)) {
        const sourceMap = sanitizeSourceMap(this.getCombinedSourcemap());
        const code = instrumenter.instrumentSync(srcCode, id, sourceMap);
        const map = instrumenter.lastSourceMap();
        return { code, map };
      }
    }

Though I'm getting options.ssr value as both true & false for different files, when I run npm run dev, my app does not run properly, and an error message appears on the console, as shown in the screenshot below.

error code coverage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions