cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.85k stars 3.17k forks source link

'webpack-preprocessor': project is missing dependency '@types/bluebird' #9570

Closed samijaber closed 1 year ago

samijaber commented 3 years ago

Current behavior

Cypress project type-checking fails if we try to type-check cypress/plugins/index.js and it includes require('@cypress/webpack-preprocessor')

image

Desired behavior

Type-checking succeeds

Test code to reproduce

// This function is called when a project is opened or re-opened (e.g. due to the project's config
// changing).
// read more: https://on.cypress.io/plugins-guide

const webpackPreprocessor = require('@cypress/webpack-preprocessor');

/** @type {Cypress.PluginConfig} */
module.exports = (on, config) => {
  on(
    'file:preprocessor',
    webpackPreprocessor({
      webpackOptions: {},
    }),
  );
  return config;
};

Versions

Introduced in https://github.com/cypress-io/cypress-webpack-preprocessor/pull/83/files#diff-dcdc3e0b3362edb8fec2a51d3fa51f8fb8af8f70247e06d9887fa934834c9122R2 (merged in v5.2.1)

From looking around, it seems that @types/bluebird is not provided as a dependency in any of the cypress packages. It seems weird to me that users need to figure out on their own that this dependency is needed. If usage of @cypress/webpack-preprocessor requires a @types/ module to type-check, I would expect it to be in dependencies and installed automatically.

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot commented 1 year ago

This issue has been closed due to inactivity.