Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createEsbuildPlugin is not compatible with esbuild versions after 0.18.13 and the esbuild-ts example can't build #1068

Closed
3 tasks done
runenielsen opened this issue Aug 9, 2023 · 3 comments

Comments

@runenielsen
Copy link

Current behavior

Something was changed in esbuild version 0.18.14, that makes it incompatible with cypress-cucumber-preprocessor's createEsbuildPlugin method, which causes the esbuild-ts example build to fail.

Desired behavior

The esbuild-ts example should build succesfully. Preferably by making cypress-cucumber-preprocessor compatible with the newest version of esbuild (which is currently 0.19.0)

Test code to reproduce

The issue can be reproduced like this from the example code in this repository:

% git clone git@github.com:badeball/cypress-cucumber-preprocessor.git
% cd cypress-cucumber-preprocessor/examples/esbuild-ts
% npm install
% npx tsc

cypress.config.ts:16:17 - error TS2322: Type 'import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/esbuild/lib/main").Plugin' is not assignable to type 'import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/esbuild/lib/main").Plugin'.
  Types of property 'setup' are incompatible.
    Type '(build: import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/esbuild/lib/main").PluginBuild) => void | Promise<...>' is not assignable to type '(build: import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/esbuild/lib/main").PluginBuild) => void | Promise<void>'.
      Types of parameters 'build' and 'build' are incompatible.
        Type 'import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/esbuild/lib/main").PluginBuild' is not assignable to type 'import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/esbuild/lib/main").PluginBuild'.
          The types of 'initialOptions.loader' are incompatible between these types.
            Type '{ [ext: string]: import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/esbuild/lib/main").Loader; }' is not assignable to type '{ [ext: string]: import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/esbuild/lib/main").Loader; }'.
              'string' index signatures are incompatible.
                Type 'import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/esbuild/lib/main").Loader' is not assignable to type 'import("/private/tmp/cypress-cucumber-preprocessor/examples/esbuild-ts/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/esbuild/lib/main").Loader'.
                  Type '"local-css"' is not assignable to type 'Loader'.

16       plugins: [createEsbuildPlugin(config)],
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in cypress.config.ts:16

Versions

  • Cypress version: 12.17.3
  • Preprocessor version: 18.0.3
  • Node version: v18.17.0

Checklist

  • I've read the FAQ.
  • I've read instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@badeball
Copy link
Owner

Hi @runenielsen, thanks for reporting this. I've updated the dependency on esbuild and released v18.0.4.

@runenielsen
Copy link
Author

Excellent, thanks a lot for the quick fix!

@QuantariusRay
Copy link

I'm seeing this as an issue now:

image

I'm assuming similar issue. Is there something here that stands out as something I could have wrong during migration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants