{"id":26548,"library":"typescript-cypress","title":"typescript-cypress","description":"A Cypress plugin that transpiles TypeScript test files using Webpack during test execution. Version 1.0.5 is current and appears to be a stable release. The plugin wraps a custom Webpack configuration with loaders like babel-loader and TypeScript presets, writes the bundled output to a temporary `tests_build` folder inside `cypress`, and deletes it after the browser closes. Unlike the official @cypress/webpack-preprocessor or cypress-webpack-preprocessor, this package bundles its own Webpack configuration and requires users to manually define loaders. It has no recent updates and limited community adoption. Key differentiator: provides a ready-to-use transpiler wrapper but lacks flexibility and documentation for complex setups.","status":"active","version":"1.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/rubendmatos1985/typescript-cypress","tags":["javascript","cypress","typescript-cypress-webpack","typescript","react-typescript-cypress-webpack","cypress-plugin"],"install":[{"cmd":"npm install typescript-cypress","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-cypress","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-cypress","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS-only; ESM import will fail.","wrong":"import { typescriptCypressTranspiler } from 'typescript-cypress'","symbol":"typescriptCypressTranspiler","correct":"const { typescriptCypressTranspiler } = require('typescript-cypress')"},{"note":"Package does not have a default export; its default export is undefined, so `require('typescript-cypress').typescriptCypressTranspiler` is required.","wrong":null,"symbol":"default export","correct":"const typescriptCypressTranspiler = require('typescript-cypress')"},{"note":"Because there is no default export, using `.default` will be undefined. CommonJS pattern above is correct.","wrong":"const { typescriptCypressTranspiler } = require('typescript-cypress')","symbol":"typescriptCypressTranspiler","correct":"const { typescriptCypressTranspiler } = require('typescript-cypress').default"}],"quickstart":{"code":"// Install: npm i typescript-cypress -D\n// cypress/plugins/index.js\nconst { typescriptCypressTranspiler } = require('typescript-cypress');\n\nconst _module = {\n  rules: [\n    {\n      test: /\\.tsx?$/,\n      use: [\n        {\n          loader: 'babel-loader',\n          options: {\n            presets: [\n              ['@babel/preset-env'],\n              '@babel/preset-typescript',\n              ['@babel/preset-react', { development: true }]\n            ],\n            plugins: [\n              '@babel/plugin-transform-destructuring',\n              '@babel/plugin-proposal-object-rest-spread',\n              '@babel/plugin-transform-typescript',\n              '@babel/plugin-transform-parameters',\n              '@babel/plugin-proposal-export-default-from',\n              ['@babel/plugin-transform-runtime', { corejs: 2 }]\n            ]\n          }\n        }\n      ],\n      exclude: /node_modules/\n    }\n  ]\n};\n\nmodule.exports = (on, config) => {\n  on('file:preprocessor', typescriptCypressTranspiler(_module));\n};","lang":"javascript","description":"Shows how to configure typescript-cypress in cypress/plugins/index.js with a custom Webpack module rule using babel-loader and TypeScript presets."},"warnings":[{"fix":"Use require() instead of import.","message":"The package is CommonJS-only; using ESM imports will fail with a Module not found error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure no other plugin uses the same folder name, or consider using an alternative preprocessor that allows custom output paths.","message":"The package creates a temporary folder 'tests_build' inside cypress/ which may conflict with other plugins or custom folders.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Webpack 4.41.5 or check compatibility with your version; consider using @cypress/webpack-preprocessor for broader support.","message":"Webpack 4.41.5 is the only tested version; using Webpack 5 may cause incompatibilities due to removed Node.js polyfills or changed API.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Manually delete cypress/tests_build if you encounter stale files or build errors.","message":"The package deletes the tests_build folder on browser close; if the browser crashes, leftovers may persist and accumulate.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install typescript-cypress --save-dev` and ensure node_modules contains it.","cause":"The package is not installed or is listed in devDependencies but not resolved.","error":"Cannot find module 'typescript-cypress'"},{"fix":"Use `const { typescriptCypressTranspiler } = require('typescript-cypress');`","cause":"Using default import instead of named import; the package exports an object with the function.","error":"TypeError: typescriptCypressTranspiler is not a function"},{"fix":"Ensure the module rules include test: /\\.tsx?$/ with appropriate loaders (babel-loader + presets).","cause":"Webpack configuration does not include a rule for .tsx? files or required loaders are missing.","error":"Module parse failed: Unexpected token (1:8) in cypress/integration/example.spec.ts"},{"fix":"Install webpack version 4: `npm install webpack@4.41.5 --save-dev`.","cause":"Webpack is not installed; the plugin does not bundle webpack as a dependency.","error":"Error: Cannot find module 'webpack'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}