Skip to content

broken initial cypress.config.ts #10

@patrickkmatias

Description

@patrickkmatias

the initial cypress.config.ts file contains a typecasting to any that breaks cypress on opening

removing it solves the issue, but makes typescript complain that framework property can only accept react, svelte or vue.

initial cypress.config.tsfile:

import { defineConfig } from "cypress";

export default defineConfig({
  component: {
    devServer: {
      framework: "cypress-ct-qwik" as any, // this line breaks cypress
      bundler: "vite",
    },
  },
});

logs:

SyntaxError: Unexpected identifier 'as'
    at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:353:18)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1385:24)
    at Module._compile (node:internal/modules/cjs/loader:1536:5)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16)
    at loadFile (/home/patrickkmatias/.cache/Cypress/12.17.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)
    at EventEmitter. (/home/patrickkmatias/.cache/Cypress/12.17.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)
    at EventEmitter.emit (node:events:518:28)
    at process. (/home/patrickkmatias/.cache/Cypress/12.17.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
    at process.emit (node:events:518:28)

after removing it, typescript starts complaining:

Type '"cypress-ct-qwik"' is not assignable to type '"react" | "vue" | "svelte"'.ts(2322)
(property) framework: "cypress-ct-qwik"

it happens both in 1.x and 2.x

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